I'm new to writing macros and would like to check if a Sheet name contains a '#' or not.. ie: "1" vs. "1#". So far I have this:
If Sheets("1#") Then Sheets("Final Schedule").Select
Range("B4:Y4").Select
Selection.Copy
Sheets("1#").Select
Range("C14").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ElseIf Sheets("1") Then Sheets("Final Schedule").Select
Range("B4:G4").Select
Selection.Copy
Sheets("1").Select
Range("C14").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Final Schedule").Select
Range("H4:W4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("1").Select
Range("I12").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Final Schedule").Select
Range("X4:Y4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("1").Select
Range("Y14").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End If
But am getting the msg: Compile error: Else without If
I'm sure this is something simple, but I can't figure it out
If Sheets("1#") Then Sheets("Final Schedule").Select
Range("B4:Y4").Select
Selection.Copy
Sheets("1#").Select
Range("C14").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ElseIf Sheets("1") Then Sheets("Final Schedule").Select
Range("B4:G4").Select
Selection.Copy
Sheets("1").Select
Range("C14").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Final Schedule").Select
Range("H4:W4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("1").Select
Range("I12").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Final Schedule").Select
Range("X4:Y4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("1").Select
Range("Y14").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End If
But am getting the msg: Compile error: Else without If
I'm sure this is something simple, but I can't figure it out
