Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50121

[SOLVED] Referencing other workbooks through VBA

$
0
0
Hi

I want to do a vlookup on a workbook called WorkforceReport, but I can't work out how to use my main sheet (RTW Tracker) as well as the new one. When I run the code below I get a 424 error on RTWTracker as its empty.
Can someone please point me in the right direction?

My code is

Code:

Dim WorkforceReportFileName As String
Dim RTWTracker As Workbook

RTWTracker = Active.Workbook
WorkforceReport = "\\ant\dept-eu\BHX1\fc-oaa\WFR\" & Format(Date, "yyyy") & "\Week " & Format(Date, "ww") & "\" & Format(Date, "dddd") & ".xlsx"
Workbooks.Open Filename:=WorkforceReport
Activate.Workbooks (RTWTracker)
'Do stuff here
Workbooks(WorkforceReport).Close Save:=False


Viewing all articles
Browse latest Browse all 50121

Trending Articles