Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I currently have a number of strings which are declared as hard code in the macro for example dim folderloc as String folderloc = "C:\Development\filename.xls" I would like to look this up from a cell in the workbook. So that Sheet1 A1 would have the value C:\Development\filename.xls and this would be passed to my code How would I do this. Many Thanks Sean |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i am assuming you want to open the file
Workbooks.Open Filename:=Range("A1").Value, _ ReadOnly:=True, UpdateLinks:=3 -- Gary "sean_f" wrote in message oups.com... Hello, I currently have a number of strings which are declared as hard code in the macro for example dim folderloc as String folderloc = "C:\Development\filename.xls" I would like to look this up from a cell in the workbook. So that Sheet1 A1 would have the value C:\Development\filename.xls and this would be passed to my code How would I do this. Many Thanks Sean |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
dim folderloc as string
folderloc=Worksheets("Sheet1").Range("A1").Value For better readability you could name ("FolderLocation") your range, in which case you could use: folderloc=Range("FolderLocation").Value HTH -- AP "sean_f" a écrit dans le message de oups.com... Hello, I currently have a number of strings which are declared as hard code in the macro for example dim folderloc as String folderloc = "C:\Development\filename.xls" I would like to look this up from a cell in the workbook. So that Sheet1 A1 would have the value C:\Development\filename.xls and this would be passed to my code How would I do this. Many Thanks Sean |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks,
I'll use that. sean |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
forgot to qualify the sheet
Workbooks.Open Filename:=Sheets("Sheet1").Range("A1").Value, _ ReadOnly:=True, UpdateLinks:=3 or this Dim fname As String fname = Sheets("sheet1").Range("a1") Workbooks.Open Filename:=fname, _ ReadOnly:=True, UpdateLinks:=3 -- Gary "sean_f" wrote in message oups.com... Hello, I currently have a number of strings which are declared as hard code in the macro for example dim folderloc as String folderloc = "C:\Development\filename.xls" I would like to look this up from a cell in the workbook. So that Sheet1 A1 would have the value C:\Development\filename.xls and this would be passed to my code How would I do this. Many Thanks Sean |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many Thanks that works perfectly
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
clear all zero-length strings from spreadsheet? | Excel Discussion (Misc queries) | |||
clear all zero-length strings from spreadsheet? | Excel Discussion (Misc queries) | |||
clear all zero-length strings from spreadsheet? | Excel Discussion (Misc queries) | |||
VB Assigning Values to a Series of Strings | Excel Discussion (Misc queries) | |||
Convert values to strings | Excel Programming |