Duplicating cells down a column by an amount expressed in a single cell.

Austin7sims

New Member
Joined
Mar 17, 2023
Messages
1
Office Version
  1. 2021
Platform
  1. Windows
I'm not sure how to ask this without just jumping into the problem... So here it is:
I have a table that has door types and corresponding info for said door types. that data is linked to another table that has a drop down. So if you have 3 "Type A"s and 6 "Type B"s, you only need to type the info once, then select "Type A" 3 times and "Type B" 6 times from the drop down. My problem now is I want to add a "Number of Doors" column. So instead of having to select Door Type A 100 times, I can just type "100" in the cell and it will populate the info for Type A 100 times in the main table. I have tried everything I can think of to do this but can't figure it out.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi,
You can adapt the following Event macro
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
' String located in cell A1 and Total Number of Rows in cell B1
If Target.Count > 1 Then Exit Sub
If Target.Address <> "$B$1" Then Exit Sub
Range("A1").Copy Destination:=Range("A1:A" & Target.Value)
End Sub
 
Upvote 1
Solution
Glad to see you liked the code ... and that it could help :)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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