Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up a workbook Amin Setting up and Configuration of Excel 0 April 23rd 10 01:43 PM
Setting up protection on a workbook brown1965 Excel Worksheet Functions 2 January 11th 09 10:00 PM
setting the default printer for this workbook only mikecoxffbb Excel Worksheet Functions 1 October 25th 08 01:47 AM
Setting values in a cell Stephen Excel Discussion (Misc queries) 3 July 10th 08 08:23 PM
Help with setting up a sales tracking workbook Sal Excel Discussion (Misc queries) 0 April 9th 08 10:14 PM


All times are GMT +1. The time now is 07:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"