Having trouble with a For Loop and counting using variables

missouridawg

New Member
Joined
Mar 7, 2019
Messages
7
due to the "A3" type locator references. If I could identify both cells using numbers (for example 3, 3 for something in cell C3) I think i could get this to work out... but I'm not quite savvy enough to do it without that kind of referencing.

Here's a specific request:
Let's say I have 3 rows of data and that data spans from columns 1 through 3. This means I have data in:
A1, A2, A3
B1, B2, B3
C1, C2, C3

How would I write a For Loop to take each row of data and paste it into a new sheet in cells B5, B10, and B15 for the data in row 1. Then take row 2 and paste it into cells 47 rows directly below the preceding row... meaning data piece B1 would go into new sheet cell B52, data piece B2 would get into B57 in new sheet, and data piece B3 would get into B62 in new sheet. Same thing for row C... I need it to be 47 spaces below the previous row.

Any help is greatly appreciated!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Code for macro
Code:
Sub WriteData()
Dim Clm As Long, Ro As Long, TA As Long, TB As Long


For Ro = 1 To 3
    For Clm = 1 To 3
    Sheets("NewSheet").Range("B5").Offset((Ro - 1) * 47 + (Clm - 1) * 5, 0) = Cells(Ro, Clm)
    Next Clm
Next Ro


End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,477
Messages
6,125,036
Members
449,205
Latest member
Eggy66

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