Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if i have workbook1 open can i reference a cell value in
a different workbook that is closed (workbook2). so if i had: Private Sub CommandButton1_Click() workbook1.sheets("Sheet1").range("A1").value = _ workbook2.sheets("sheet1").range("Q98").value End Sub would something like this work? i am not sure on the syntax of referencing a different workbook. i am actually tring to import a range of workbook2 into workbook1. or more specifically copy a range from 1 into 2. TIA...S |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub CommandButton1_Click()
With workbook1.sheets("Sheet1").range("A1") .Formula = "=" & _ "'C:\Folder\[workbook2.xls]Sheet1'!Q98" .Formula = .Value End With End Sub Linking to a closed workbook is more easily done through Excel. VBA doesn't support it. -- Regards, Tom Ogilvy spence wrote in message ... if i have workbook1 open can i reference a cell value in a different workbook that is closed (workbook2). so if i had: Private Sub CommandButton1_Click() workbook1.sheets("Sheet1").range("A1").value = _ workbook2.sheets("sheet1").range("Q98").value End Sub would something like this work? i am not sure on the syntax of referencing a different workbook. i am actually tring to import a range of workbook2 into workbook1. or more specifically copy a range from 1 into 2. TIA...S |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
can't click on cell to reference to another workbook | Excel Worksheet Functions | |||
workbook/cell reference w/ formula | Excel Worksheet Functions | |||
How to reference a cell in a different workbook using a drop down | Excel Discussion (Misc queries) | |||
Use the value of a cell within a reference to another workbook? | Excel Worksheet Functions | |||
cell reference in another workbook | Excel Discussion (Misc queries) |