PDA

View Full Version : Repeat A Value In A Predefined Number Of Rows Using Formula



mahmoud-lee
05-31-2013, 05:00 PM
Required
1 re-repeating number 100 in column A
Without pulling down cell
ineed that by formula , no code
I think I reached resolve in the sheet (AA 2)

Excel Fox
06-01-2013, 12:13 AM
=IF($B$2>=(ROW($A$2:$A$380)-1),$C$2,"") would be a much simpler approach

mahmoud-lee
06-01-2013, 02:46 AM
Ingenious solution and beauty of simplicity

If I want the solution by code?

Excel Fox
06-01-2013, 01:42 PM
Sub RepeatValue()

Range("A2:A" & Range("A" & Rows.Count).End(xlUp).Row).ClearContents
Range("A2").Resize(Range("B2").Value).Value = Range("C2").Value

End Sub

mahmoud-lee
06-01-2013, 02:22 PM
you are very kind thanks a lot