Hello I really need some help with my coding in Excel 2007.
I have 80 worksheets in my workbook. I am trying to evaluate each sheet so that if there is a "Y" in a certain range of worksheets ("M" for Monday), then that sheet's data will be pasted to the sheet that begins with P (for prior week). There are 10 of these PW1, PW2, etc.
Dim ws As Worksheet
Dim ws1 As Worksheet
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If Left(ws.Name, 1) = "M" And ws.Range("B2").Value = "Y" Then 'evaluate if yes
ws.Range("A4:R37").Copy
ElseIf Left(ws1.Name, 1) = "P" And ws1.Range("A4").Value Is Null Then
ws1.Range("a4").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End If
Next ws
Sheets("108 Compare").Select
Range("A81").Select
Application.ScreenUpdating = True
the code fails on the ElseIf line.
Bookmarks