Hi all

need a little help please. i'm using VB (but very very rusty) and i need to write a simple macro to cut and paste in excel.

the macro so far is:

Sub populate()
' populate Macro
' Macro recorded 09/02/2010 by


    'select correct cell
    'enter lookup
    ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[-1],'10'!C6:C7,2,0)"
    'copy selection
    'paste first half
    'paste second half

End Sub

but, what i want to do is paste the range along the sheet from column D to column CX (incrementing in 2's as i go along)..

so i would paste in D, then F, then H etc....

how do i do it? can i use a variable for the column and increment this in a loop or is there some other way??

thanks in advance

thats what i did....

but it doesnt show how to increment the cell values..

its sorted now, i can use a variable by using the cells keyword instead of the actual cell reference.

This question has already been answered. Start a new discussion instead.