Sub test()
i = 10
Do While Cells(i, "Z") <> ""
Debug.Print "Z" & i & " = " & Cells(i, "Z")
i = i + 1
Loop
End Sub
Sub test()
Row = ActiveCell.Row
col = ActiveCell.Column
Debug.Print "Active Cell at Row: " & Row & ", Col: " & GetColumnName(col)
Debug.Print "Rows with values till active cell:"
For i = 1 To Row
If Cells(i, col) <> "" Then
Debug.Print GetColumnName(col) & i & " = " & Cells(i, col)
End If
Next
End Sub
Function GetColumnName(ByVal colNum As Integer) As String
Dim d As Integer
Dim m As Integer
Dim name As String
d = colNum
name = ""
Do While (d > 0)
m = (d - 1) Mod 26
name = Chr(65 + m) + name
d = Int((d - m) / 26)
Loop
GetColumnName = name
End Function
Dim k As Long, z As Long
k = ActiveCell.Row
z = 1
Do Until z > 10
Cells(k, z).Value = 1
z = z + 1
Loop
Dim k As Long, z As Long
k = ActiveCell.Row
z = 1
Do Until k > 25
Do Until z > 10
Cells(k, z).Value = 1
z = z + 1
Loop
k = k + 1
Loop
Dim rng As Range, cell As Range
Set rng = Range("A1:AB100")
For Each cell In rng
Next cell
Open in new window
This populate values in row-1 starting from A Column till the time column count reaches 10..
Saurabh...