ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Opening Variable File Names (https://www.excelbanter.com/excel-programming/316938-opening-variable-file-names.html)

simoncohen[_7_]

Opening Variable File Names
 

I need to write a Macro to ask for an input number (say 123) and the
open a series of workbooks based on this input - e.g. AA123.xls
AB123.xls. Can anybody please suggest some code to enable this. Thank

--
simoncohe
-----------------------------------------------------------------------
simoncohen's Profile: http://www.excelforum.com/member.php...nfo&userid=785
View this thread: http://www.excelforum.com/showthread.php?threadid=31369


Bob Phillips[_6_]

Opening Variable File Names
 
ans= Inputbox("Please supply file id")
If ans < "" Then
Workbooks.Open Filename:= "AA" & ans & ".xls"
End if

--

HTH

RP
(remove nothere from the email address if mailing direct)


"simoncohen" wrote in message
...

I need to write a Macro to ask for an input number (say 123) and then
open a series of workbooks based on this input - e.g. AA123.xls,
AB123.xls. Can anybody please suggest some code to enable this. Thanks


--
simoncohen
------------------------------------------------------------------------
simoncohen's Profile:

http://www.excelforum.com/member.php...fo&userid=7854
View this thread: http://www.excelforum.com/showthread...hreadid=313695





All times are GMT +1. The time now is 07:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com