If Else problem in an excel macro
Solved/Closed
Related:
- If Else problem in an excel macro
- Spell number in excel without macro - Guide
- Macros in excel download - Download - Spreadsheets
- Marksheet in excel - Guide
- How to take screenshot in excel - Guide
- Excel free download - Download - Spreadsheets
4 responses
It is still throwing the "Else without If" statement. What do I do now? Help please
If Range("B2") = 0 Then Range("A3").Select
ActiveSheet.Paste
Else
Range("A2").Select
ActiveSheet.Paste
End If
If Range("B2") = 0 Then Range("A3").Select
ActiveSheet.Paste
Else
Range("A2").Select
ActiveSheet.Paste
End If
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Mar 4, 2010 at 09:54 AM
Mar 4, 2010 at 09:54 AM
Your problem is this
If Range("B2") = 0 Then Range("A3").Select
move
Range("A3").Select
to a next line
so it looks like
If Range("B2") = 0 Then
Range("A3").Select
If Range("B2") = 0 Then Range("A3").Select
move
Range("A3").Select
to a next line
so it looks like
If Range("B2") = 0 Then
Range("A3").Select
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
Mar 2, 2010 at 02:42 AM
Mar 2, 2010 at 02:42 AM
If Range("B2") = 0 Then
Range("A2").Select
ActiveSheet.Paste
Else
Range("A3").Select
end if
Range("A2").Select
ActiveSheet.Paste
Else
Range("A3").Select
end if