find data another workbook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

Thanks in advance Don't know to reference another workbook with folder and
file name.

Looking at the following code I am unsure how to get information from other
spreadsheets.

In the loop the folder will look at various stores. The following shows
perth but does not look at it. I have 10 other stores to look at.

How do I reference another workwook.


Dim strLookSheet As String
Dim varAnswer As Variant
Dim strWorkbookFolder As String
Dim strWorkbookFile As String

strWorkbookSheet = "Meats"
strWorkbookFolder = "C:\data\perthstore\"
strWorkbookFile = "Today_Sales"

varAnswer = Worksheets(strWorkbookSheet).Range("D6").Value





thanks for all your help.

Trev B
 
strWorkbookSheet = "Meats"
strWorkbookFolder = "C:\data\perthstore\"
strWorkbookFile = "Today_Sales"

Workbooks.Open Filename:= _
strWorkbookFolder & strWorkbookFile

Windows(strWorkbookFile).Activate
varAnswer = Worksheets(strWorkbookSheet).Range("D6").Value
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top