How to make a cell result copy itself into subsequent cells "X" number of times

bran987

New Member
Joined
Jan 10, 2005
Messages
45
Say I have (cell A1) 10 salespeople and they each sell a (A2) $100/month membership, so I have (A3) $1,000 monthly revenue.

(A4) is an assumption about how many months the average person will stay a member.

So if A4 = 6, (6 month membership assumption) how would I get Excel to output $1,000 (the result from A3) into cells B3 through B8

but then for instance if A4 = 3 (3 month membership assumption) it would only output the the $1,000 result from A3 into cells B3 through B5

Does that make sense?

So like A1 through A4 of...

10
$100
$1,000
6

would output $1,000 into B3 through B8

but

10
$100
$1,000
3

would output $1,000 only to B3 to B5

Thanks if that makes sense!
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi bran987,

Try this event macro* on the sheet in question:

Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

    Dim lngEndRow As Long
    
    lngEndRow = Cells(Rows.Count, "B").End(xlUp).Row
    
    If lngEndRow >= 3 Then Range("B3:B" & lngEndRow).ClearContents
    
    With Application
        .ScreenUpdating = False
        .EnableEvents = False
    End With
    
        Range("B3:B" & 3 + Range("A4").Value - 1).Value = Range("A3").Value
    
    With Application
        .ScreenUpdating = True
        .EnableEvents = True
    End With

End Sub

HTH

Robert

* To install this macro follow these four steps:

1. Copy my code above to the clipboard (Ctrl + C)
2. Right click on the tab you wish the code to run on and from the shortcut menu select View Code
3. Paste in my code (Ctrl + V) from step 1
4. From the File menu click on Close and Return to Microsoft Excel
 
Upvote 0

Forum statistics

Threads
1,214,893
Messages
6,122,118
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