Hi,
A user is having issues trying to open a file with the below macro code. I don't believe this is an issue for anyone else.
The code and error are both below.
Does anyone have an idea of what this relates to?
Thanks in advance
Ryan
A user is having issues trying to open a file with the below macro code. I don't believe this is an issue for anyone else.
The code and error are both below.
Does anyone have an idea of what this relates to?
Thanks in advance
Ryan
Code:
Private Sub Workbook_Open() Application.WindowState = xlMaximized
Call MonkeyNuts
End Sub
Sub MonkeyNuts()
Dim wkb As Workbook: Set wkb = Workbooks.Open("I:\Content & Creative\Design Admin\_Revenue\Control\Data.xlsx", True, True)
Dim LR As Long
With wkb
'Change the sheetname "Time" to name of second sheet. Or use Sheets(2), assuming the index number of the sheet relates to the second sheet shown in your spreadsheet
LR = .Sheets("Time").Cells(.Sheets("Time").Rows.Count, 1).End(xlUp).Row
ThisWorkbook.Sheets("Time").Range("B1:Y30000").Value = .Sheets("Time").Range("A1:X30000").Value
LR = .Sheets("Jobs").Cells(.Sheets("Jobs").Rows.Count, 1).End(xlUp).Row
ThisWorkbook.Sheets("Jobs").Range("A1:Z2000").Value = .Sheets("Jobs").Range("A1:Z2000").Value
LR = .Sheets("Billing").Cells(.Sheets("Billing").Rows.Count, 1).End(xlUp).Row
ThisWorkbook.Sheets("Billing").Range("A1:Q30000").Value = .Sheets("Billing").Range("A1:Q30000").Value
LR = .Sheets("Costs").Cells(.Sheets("Costs").Rows.Count, 1).End(xlUp).Row
ThisWorkbook.Sheets("Costs").Range("A1:U30000").Value = .Sheets("Costs").Range("A1:U30000").Value
.Close False
End With
Sheets("CC").Select