I forgot to include that part about wsWafer. There are 700+ lines in the macro and I only wanted to include the part that was relevant to the error.
Dim FirstFourRunNo As String, LastTwoRunNo As String, GrowthPrefix As String
Dim wsWafer As Worksheet
Dim RunNo As String
RunNo = Mid(ThisWorkbook.Name, 17, 6)
GrowthPrefix = InputBox("Please enter the wafer prefix (SPV, SPW, or SPL)", "Wafer Prefix")
FirstFourRunNo = Mid(RunNo, 1, 4)
LastTwoRunNo = Mid(RunNo, 5, 2)
For Each wsWafer In Sheets(Array("A-G", "A-N", "B-G", "B-N", "C-G", "C-N", "D-G", "D-N", "E-G", "E-N", "F-G", "F-N", _
"G-G", "G-N", "H-G", "H-N", "I-G", "I-N", "J-G", "J-N"))
Range("W27:Y27").Value = GrowthPrefix & FirstFourRunNo & "-" & LastTwoRunNo & wsWafer & "Fine X1"
Next wsWafer
That is with the lines declaring wsWafer. I just tried wsWafer.Name and it worked!. Thanks NigelFrost
Bookmarks