Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting values in another workbook
A simple question. How do I set a cell value in another
workbook without activating it first? Let's say I have two workbooks (WB1.xls and WB2.xls) and I need to fill in range A1..A5 in WB1.xls with values from range A1..A5 in WB2.xls (and I don't want to use copy method). I have tried this kind of solution: Windows("WB1.xls").Activate For X=1 to 5 'this next line gives me an error Windows("WB2.xls").Sheets("Sheet1").Cells(X,1)=Cel ls(X,1) Next X but it is not working. How should I solve this? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting values in another workbook
Of course!!!!
Thank You. -----Original Message----- Windows("NG Stats.xls").Activate For X = 1 To 5 'this next line gives me an error Workbooks("results.xls").Sheets("Sheet1").Cells(X, 1) = Cells(X, 1) Next X -- HTH ------- Bob Phillips ... looking out across Poole Harbour to the Purbecks "Ecco" wrote in message ... A simple question. How do I set a cell value in another workbook without activating it first? Let's say I have two workbooks (WB1.xls and WB2.xls) and I need to fill in range A1..A5 in WB1.xls with values from range A1..A5 in WB2.xls (and I don't want to use copy method). I have tried this kind of solution: Windows("WB1.xls").Activate For X=1 to 5 'this next line gives me an error Windows("WB2.xls").Sheets("Sheet1").Cells(X,1)=Cel ls (X,1) Next X but it is not working. How should I solve this? . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Setting up a workbook | Setting up and Configuration of Excel | |||
Setting up protection on a workbook | Excel Worksheet Functions | |||
setting the default printer for this workbook only | Excel Worksheet Functions | |||
Setting values in a cell | Excel Discussion (Misc queries) | |||
Help with setting up a sales tracking workbook | Excel Discussion (Misc queries) |