Copying data based on a separate column

Atvolpini

New Member
Joined
Oct 26, 2017
Messages
15
Hi All,

I am coming to you with a question regarding filling in large amounts of data. I have a script which generates a column of data based on a couple fields my end users fill in. The next step I would like to automate is filling in other fields of each row for each value generated by the first script. The very first row is filled in by the end users based on controlled vocabulary/data validation. I need to copy the values down each column until i reach the last value of the 1st column. Here is what I mean graphically:

Here is what the table looks like after the first script:
[TABLE="class: grid, width: 192, align: center"]
<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"]ID Code[/TD]
[TD="width: 64"]Letter[/TD]
[TD="width: 64"]Number[/TD]
[/TR]
[TR]
[TD]A1[/TD]
[TD]a[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]A2[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]A3[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]A4[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]A5[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]A6[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]A7[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]A8[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]A9[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]A10[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]A11[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]A12[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
And here is what I need to happen:

[TABLE="class: grid, width: 192, align: center"]
<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"]ID Code[/TD]
[TD="width: 64"]Letter[/TD]
[TD="width: 64"]Number[/TD]
[/TR]
[TR]
[TD]A1[/TD]
[TD]a[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]A2[/TD]
[TD]a[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]A3[/TD]
[TD]a[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]A4[/TD]
[TD]a[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]A5[/TD]
[TD]a[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]A6[/TD]
[TD]a[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]A7[/TD]
[TD]a[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]A8[/TD]
[TD]a[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]A9[/TD]
[TD]a[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]A10[/TD]
[TD]a[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]A11[/TD]
[TD]a[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]A12[/TD]
[TD]a[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]

In reality, there are many more columns than just "letter" and "number" but im hoping to just adjust the code. I tried to figure out how to do this on my own, but my VBA skills are still pretty weak.

Thanks in advance!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
How about
Code:
Sub MyFillDown()
   Range("A2", Range("A" & Rows.Count).End(xlUp)).Offset(, 1).Resize(, 2).Filldown
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,300
Members
452,633
Latest member
DougMo

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