VBA attempt in baby steps

Status
Not open for further replies.

gint3232

New Member
Joined
Jan 12, 2015
Messages
16
Hi everyone,

I am attempting to build a VBA loop that'll go through all populated data in each cell with columns "A" and "B"

and in doing so move each value in these cells from A2:B2 to E2:F2, & then loop to the next row and move A3:B3 to E3:F3.. etc etc

I am not any good with VBA loops and also recording a macro does not provide an example either!! so here my pitiful vba effort so far, which is obviously useless as it stays on the same line for each loop

So question is ...How do i loop from cells A to B & C, Etc????

Code:
    Dim Cl As Range
    Dim Cnt As Long

    For Each Cl In Range("A2", Range("A" & Rows.Count).End(xlUp))
    Cnt = 2

    ''''ActiveCell.Offset(??,??).Select thought I try this but No idea how!

    Range("A" & Cnt & ":" & "B" & Cnt).Select
    Selection.Copy Destination:=Range("E" & Cnt & ":" & "F" & Cnt)
          
     Cnt = Cnt + 1
     Next Cl

many thanks for reading!
 
Last edited:

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Status
Not open for further replies.

Forum statistics

Threads
1,214,812
Messages
6,121,696
Members
449,048
Latest member
81jamesacct

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top