Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default creating a value for a file name

hello is it possible to create a variable for a file name:
for example x.xls where x=cell A1
I am trying to create a vlook up formula that can access differnt xls files
=vlookup([x.xls]!,A2:A4,2) something like that
I can't get x to be a variable equal to whatever is in cell A1
this one is a toughy....
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default creating a value for a file name

x = cells(1, 1).Value
Workbooks(x).Activate

Or

x = Range("A1").Value
Workbooks(x).Activate

In either of those two syntax you would need to be in the active worksheet,
otherwise you would have to specify the worksheet like:

x = Worksheets(2).Cells(1, 1).Value
Workbooks(x).Activate

Your active workbook would have to be in the same directory as the workbook
you call from Range("A1"), if you do not have the entire path in that cell.

"BEAST" wrote:

hello is it possible to create a variable for a file name:
for example x.xls where x=cell A1
I am trying to create a vlook up formula that can access differnt xls files
=vlookup([x.xls]!,A2:A4,2) something like that
I can't get x to be a variable equal to whatever is in cell A1
this one is a toughy....

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a help file Paul B Excel Programming 1 January 2nd 07 08:32 PM
Creating cub file using VBA Tecnet Excel Programming 1 June 14th 06 10:56 AM
Creating a new excel file from an existing file using macro Macro Excel Programming 2 July 28th 05 06:40 PM
Creating a help file Yoam69 Excel Programming 2 June 2nd 05 05:39 PM
creating an exe file with visual basic (installation file for Macros and Userforms) [email protected] Excel Programming 3 August 5th 04 10:16 AM


All times are GMT +1. The time now is 11:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"