View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
bw bw is offline
external usenet poster
 
Posts: 74
Default Variable Filename/Worksheet/Workbook

I'm using the following code to get the filename I want to open:

my2ndFileName = Application.GetOpenFilename("All Files (*.*), *.*")
where the actual filename is "C:\Downloads\LAS6014"

and I use the following to open the file:
Workbooks.OpenText Filename:=my2ndFileName,...

and because I don't now how to use the variable filename in the following, I hard code it
as follows:
Windows("LAS6014").Activate

So the question is: how do I activate the worksheet (or is it a workbook) for the variable
filename?

Thanks,
Bernie