Hi,
I need your help with quite a simple loop. Please see attachment.
For each column the the series 1 to 14 has to start one row below - using VBA.
Thanks
Hi,
I need your help with quite a simple loop. Please see attachment.
For each column the the series 1 to 14 has to start one row below - using VBA.
Thanks
Please * if you like the answer
Give this code a try.
Please Login or Register to view this content.
Thank you very much!
Here is another macro for you to consider...
Please Login or Register to view this content.
This code is little dynamic:
Sub fillNumbersByCols()
Dim worksheetActive As Worksheet
Dim colNumber, rowNumber, rowPointer As Integer, i As Integer
Dim startNumber, endNumber As Integer
Dim startRowNumber, startColNumber As Integer
'Initiate veriables
startNumber = 1
endNumber = 10
startRowNumber = 2
startColNumber = 2
Set worksheetActive = ThisWorkbook.ActiveSheet
With worksheetActive
colNumber = startColNumber
rowPointer = startRowNumber - 1
Do While .Cells(rowPointer, colNumber).End(xlUp).Value <> ""
For i = startNumber To endNumber
.Cells(rowPointer + i, colNumber).Value = i
Next i
rowPointer = rowPointer + 1
colNumber = colNumber + 1
Loop
End With
Set worksheetActive = Nothing
End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks