Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using a Variable in the Workbooks.Open code
Hey Ron, I gave that a shot and I couldn't get it to work. Does the variabl have to be set as a Range? When I tried it, excel gave me an error o "inexpected end of statement". I guess the extra " " was throwing i off -- Phatchef2 ----------------------------------------------------------------------- Phatchef24's Profile: http://www.excelforum.com/member.php...fo&userid=1093 View this thread: http://www.excelforum.com/showthread.php?threadid=27504 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using a Variable in the Workbooks.Open code
You can use a string also
Sub test2() Dim Myvar As String Myvar = "yourworkbookname" Workbooks.Open Filename:="\\Jelle\shareddocs\" & Myvar & ".xls" End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Phatchef24" wrote in message ... Hey Ron, I gave that a shot and I couldn't get it to work. Does the variable have to be set as a Range? When I tried it, excel gave me an error of "inexpected end of statement". I guess the extra " " was throwing it off. -- Phatchef24 ------------------------------------------------------------------------ Phatchef24's Profile: http://www.excelforum.com/member.php...o&userid=10938 View this thread: http://www.excelforum.com/showthread...hreadid=275048 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
vba code to open workbooks | Excel Worksheet Functions | |||
macro or code to open multiple workbooks | Excel Discussion (Misc queries) | |||
Using a Variable in the Workbooks.Open code | Excel Programming | |||
Sharing variable values between open workbooks? | Excel Programming | |||
VBA code for looping through open workbooks and worksheets | Excel Programming |