0

Hi,

I have a spreadsheet with data that I need to sort into a more 'usable' format, I want to repeat (/apply) this macro for all the data but am not sure on how to make it loop every 2 cells.

Sub Macro1()
'
' Macro1 Macro
'

'
    Range("C2").Select
    ActiveCell.FormulaR1C1 = "=CONCATENATE(R[1]C[-1],R[1]C,R[1]C[1],R[1]C[2])"
    Range("C2").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Application.CutCopyMode = False
    Range("B3:E3").Select
    Selection.ClearContents
    Range("C2").Select
    Selection.Cut
    Range("B3").Select
    ActiveSheet.Paste
End Sub
2
Contributors
2
Replies
7
Views
1 Year
Discussion Span
Last Post by MOD37
0

To walk through cells in excel sheet with macro use something like

Dim i As Integer

For i = 1 To 20 step 2
    Cells(i, 1).Value = 42
Next i

Posting macro recording code won't help much you know. :o)

0

Ok I will have a look at that.

Oh really, why not? :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.