VBA or Formula to autofill down

baker_89

New Member
Joined
Aug 25, 2014
Messages
42
I have a sheet that I need to autofill down from a cell value. So item A to repeat its name 40 times starting on sequence 1 than immediately after Item B 10 times and so forth. The order of Item A-D will change as well since sometimes I may want Item B first than Item A etc.

Thanks for anyone who can assist.


Item A40
Item B10
Item C5
Item D7
SequenceItem Name
1
2
3
4
5

<tbody>
</tbody>
 
Last edited:

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
So is the value
Sequence

Now in Range("A5")
And what do you want in A6?
Would it be
1 and B6 would be ItemA​
<strike></strike>
 
Last edited:
Upvote 0
Sequence is just a title i added for that column. Looking to build a schedule for items, they run a different number of batches each day so need to be able to adjust the number of each item and even the running order of each item each time before running the code. Will likely have drop down option for cells A1:A4 to choose their order and than manually enter the run count then run the code to fill the list below out.

End Result like this,

Apples5
Oranges3
Pears4
Grapes2
Running OrderItem
1Apples
2Apples
3Apples
4Apples
5Apples
6Oranges
7Oranges
8Oranges
9Pears
10Pears
11Pears
12Pears
13Grapes
14Grapes
15
16
17
18

<tbody>
</tbody>
 
Upvote 0
I assume Apple is in Range A1

But I still do not know where the value 1 is

Is this Range("A8")

Or is this on another sheet
 
Upvote 0
Maybe something like
Code:
Sub FillDownWords()
   Dim Cl As Range
   
   For Each Cl In Range("A1:A4")
      Range("B" & Rows.Count).End(xlUp).Offset(1).Resize(1 * Cl.Offset(, 1)).Value = Cl.Value
   Next Cl
   
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,891
Messages
6,122,105
Members
449,066
Latest member
Andyg666

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