Hi
I this code below but the select satement keeps producing and error of "Select method of worksheet failed"
If bLang = vbYes Then 'if the user selected yes to importing langauge data
Set PPOld = Workbooks.Open(StrFldr & "\" & "HDE_PPIII_MONTH_Input_Reference_Table_V" & bVImport & ".xlsx")
PPNew.Sheets.Add.Name = "DE": PPNew.Sheets.Add.Name = "PL"
PPNew.Sheets("EN").Select Sheets("EN").Select: Range("A:A").Copy: Sheets("DE").Select: Range("a1").PasteSpecial Paste:=xlPasteValues
Sheets("EN").Select: Range("A:A").Copy: Sheets("PL").Select: Range("a1").PasteSpecial Paste:=xlPasteValues
For Each shName In Array("DE", "PL")
shFound = False
For Each sh In Worksheets
If LCase(sh.Name) = LCase(shName) Then
shFound = True
PPOld.Sheets(shName).Range("B2:P2000").Copy Destination:=PPNew.Sheets(shName).Range("AA1")
End If
Next sh
Next shName
PPOld.Close
For Each shName2 In Array("DE", "PL")
For Each sht In Array(27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43) 'Loop through the vlookup cells and autofill the rest of the columns
With PPNew.Sheets(shName).cells(2, 2)
.Formula = "=IF(A2=0,0,VLOOKUP($A2,ConvertManual!$A$2:$Y$500," & sht & ",FALSE))"
.AutoFill .Resize(500)
End With
Next
Next shName2
End If
Does anyone know why its keeps producing an error?
Thanks
Jeskit
Bookmarks