View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Chrissy[_4_] Chrissy[_4_] is offline
external usenet poster
 
Posts: 101
Default Need Help with Code - Copy & Paste


"JStone0218" wrote in message ...
If you copy all of col A then you do not have to worry about
how many values there are. I do not think there is any reason
why you would do it one cell at a time.


Chrissy,

Thanks for your response. I need one cell copied at a time, not the entire
column. The reason, I'm working with a dynamic web query that uses cell A1 in
worksheet1 as the input data.

Again, I want the value in cell A1 in worksheet2 to be copied to A1 in
worksheet1. When this cell is changed, the web query updates. Repeat the
process, copying data from worksheet2, cell A2, to worksheet1, A1...

Any help you can provide would be appreciated.


Then you need to do a recalc after each cell is copied. Your recorded
macro did not show that you waited after each copy to have the recalc
preformed.

I believe you need to use a for each loop on the source and include in it
the recalc command. As I do not have a dynamic query to test this on
I will leave that to you - but you will find it easy with something like this

Dim oCell as Range

For Each oCell in Worksheets("Sheet2").Range("A:A")
application.calculate
worksheets("Sheet1").Range(oCell.Address) = oCell
Next oCell

You can also restrict the range used in col A to only those rows
above the last used cell in the workbook


Chrissy.