Calgary_Neil
Board Regular
- Joined
- Apr 5, 2014
- Messages
- 79
I must be getting old, I can not see what VBA is complaining about. The error is "Compile error. Argument not optional" pointing at underlined range call.
If there are better ways (cleaner, aster, efficient) please tell also
Thanks for looking
Neil
Excel 365
VBA Code:
Sub ErrorTest()
Dim NewWB As Workbook
Dim NewWS As Worksheet
Dim Folder As String
Dim OldWB As Workbook
Dim OldWS As Worksheet
Dim LTurn As Integer
'Pick New file
Set NewWB = ActiveWorkbook
Set NewWS = NewWB.Worksheets("Production")
'Pick Old File
Folder = "D:\Users\Owner\Documents\0) OneDrive\OneDrive\9) Unused\My Games\Space Empires\Current\WorkArea\"
Set OldWB = Workbooks.Open(Folder & "Gord9B_SE_4X_CE_V2.55.xlsm")
Set OldWS = OldWB.Worksheets("Production")
' For LTurn = 1 To OldWS.Range("A2").Value
LTurn = 1
'Transfer M8
NewWS.Range.Cells(8, 6 + LTurn * 7) = _
OldWS[U].Range[/U].Cells(8, 6 + LTurn * 7).Value
End Sub
If there are better ways (cleaner, aster, efficient) please tell also
Thanks for looking
Neil
Excel 365