View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jef Gorbach[_2_] Jef Gorbach[_2_] is offline
external usenet poster
 
Posts: 65
Default Loop copy/paste for x columns

On Feb 23, 8:43*am, Andrew wrote:
Hi, I've got a macro that copies formulae in column W, pastes in column X,
then copies this and pastes values (it's probably very uncouth however). *
What I'd like to to is tie this in to a loop so that it repeats along to
column CC, without having to copy in the below formulae 58 times. *Any help
would be appreciated.


You'll find it easier to read (and faster to run) if you avoid
Selecting the source range before using the Copy action. Likewise you
can simply specify your destination range as part of the Paste action.
The following two lines copies the results of the formulas in column W
to every column from X to CC which sounds like what you want?

Sub test()
Columns("W:W").Copy
Columns("X:CC").PasteSpecial Paste:=xlPasteValues
End Sub