Just a quickie guys,
If I want to reference a cell in another workbook (and it is currently open) I could use
Workbooks("Book2).Sheets("Sheet1").Cells(1,1).value
Similarily I could use
dim sht as Worksheet
set sht = Worksheets("Sheet1")
Workbooks("Book2").sht.cells(1,1).Value
However, why can I not use:
Dim wb as Workbook
Dim sht as Worksheet
Set wb = Workbooks("Book1")
Set sht = Worksheets("Sheet1")
wb.sht.cells(1,1).value
Why the hell does that not work? Lol
If I want to reference a cell in another workbook (and it is currently open) I could use
Workbooks("Book2).Sheets("Sheet1").Cells(1,1).value
Similarily I could use
dim sht as Worksheet
set sht = Worksheets("Sheet1")
Workbooks("Book2").sht.cells(1,1).Value
However, why can I not use:
Dim wb as Workbook
Dim sht as Worksheet
Set wb = Workbooks("Book1")
Set sht = Worksheets("Sheet1")
wb.sht.cells(1,1).value
Why the hell does that not work? Lol