Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a macro, part of which copies from one worksheet and pastes into another. The problem is that not only does it have to follow the same process (copy position moves nine columns, but the destination column moves two columns and then every fourth change, changes four) and I know it is poor coding to simply write it out fifteen times. An extract of the draft is provided below to give an indication: //--- Sheets("Sheet1").Range("J10:J100"). _ SpecialCells(xlCellTypeFormulas, 23).Copy Sheets("Sheet2").Range("F4").PasteSpecial _ Paste:=xlPasteValues, _ Operation:=xlNone, _ SkipBlanks:=False, _ Transpose:=False Sheets("Sheet1").Range("S10:S100"). _ SpecialCells(xlCellTypeFormulas, 23).Copy Sheets("Sheet2").Range("H4").PasteSpecial _ Paste:=xlPasteValues, _ Operation:=xlNone, _ SkipBlanks:=False, _ Transpose:=False Sheets("Sheet1").Range("AB10:AB100"). _ SpecialCells(xlCellTypeFormulas, 23).Copy Sheets("Sheet2").Range("J4").PasteSpecial _ Paste:=xlPasteValues, _ Operation:=xlNone, _ SkipBlanks:=False, _ Transpose:=False Sheets("Sheet1").Range("AK10:AK100"). _ SpecialCells(xlCellTypeFormulas, 23).Copy Sheets("Sheet2").Range("N4").PasteSpecial _ Paste:=xlPasteValues, _ Operation:=xlNone, _ SkipBlanks:=False, _ Transpose:=False ---// What I was hoping to do was change all this to a loop utilising ActiveCell.Offset Would this work and how should I do it? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
loop over columns | Excel Discussion (Misc queries) | |||
Selecting columns through a loop | Excel Programming | |||
incrementing columns in a loop | Excel Programming | |||
loop through columns | Excel Programming | |||
Loop 20 columns Help! | Excel Programming |