Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
vba cell reference
new to VBA.
trying to come up with a line of code that will open a specific worksheet based on value in cell in another workbook. both workbooks are open. -- douglass |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
vba cell reference
Workbooks.Open(Workbooks("2ndWorkbook.xls").Sheets ("Sheet1").Range("A1").Value)
will open the workbook which is sitting in A1 of Sheet1 of workbook named 2ndWorkbook.xls HTH "douglass" wrote in message ... new to VBA. trying to come up with a line of code that will open a specific worksheet based on value in cell in another workbook. both workbooks are open. -- douglass |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
vba cell reference
Assuming the other book contains the name of the sheet in cell A1 of sheet 1...
sheets(worksbooks("MyBook.xls").Sheets("Sheet1").r ange("A1").value).Select -- HTH... Jim Thomlinson "douglass" wrote: new to VBA. trying to come up with a line of code that will open a specific worksheet based on value in cell in another workbook. both workbooks are open. -- douglass |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
vba cell reference
oops -- misread the original. Jim's solution is good (would have been mine!)
"Bob Umlas" wrote in message ... Workbooks.Open(Workbooks("2ndWorkbook.xls").Sheets ("Sheet1").Range("A1").Value) will open the workbook which is sitting in A1 of Sheet1 of workbook named 2ndWorkbook.xls HTH "douglass" wrote in message ... new to VBA. trying to come up with a line of code that will open a specific worksheet based on value in cell in another workbook. both workbooks are open. -- douglass |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
vba cell reference
I appreciate the prompt responses to my inquiry. I feel I probably should
explain what I'm trying to do more clearly. I have two open worksheets. The procedure would copy data from the source worksheet then paste that information to the target worksheet. The exact target worksheet name is always in cell c7 of the source worksheet. So, based on that value, it first locates the same sheet number in the target worksheet, then pastes the data. The source worksheet (tab) name keeps changing and does not always match precisely the name in cell c7 of that sheet (which does not change) -- douglass "Bob Umlas" wrote: oops -- misread the original. Jim's solution is good (would have been mine!) "Bob Umlas" wrote in message ... Workbooks.Open(Workbooks("2ndWorkbook.xls").Sheets ("Sheet1").Range("A1").Value) will open the workbook which is sitting in A1 of Sheet1 of workbook named 2ndWorkbook.xls HTH "douglass" wrote in message ... new to VBA. trying to come up with a line of code that will open a specific worksheet based on value in cell in another workbook. both workbooks are open. -- douglass |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Changing sheet reference to cell reference | Excel Worksheet Functions | |||
Formulas that reference cells that reference another cell | Excel Discussion (Misc queries) | |||
absolute cell reference A spreadsheet cell reference that does no | Excel Discussion (Misc queries) | |||
problem with cell reference in =sum(offset(cell reference,x,y,z,a)). Want cell ref to be variable. | Excel Worksheet Functions | |||
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable | Excel Worksheet Functions |