View Single Post
 
Old 09-07-2018, 06:26 PM
Logit Logit is offline Windows 10 Office 2007
Expert
 
Join Date: Jan 2017
Posts: 587
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

.
Here is a VBA approach :

Code:
Option Explicit

Sub numcells()
Dim i As Integer
Dim x As Range

i = Range("C2").Value

For Each x In Range("B2:B100")
    If x <> "" Then
        x.Offset(0, -1) = i
        i = i + 1
    End If
Next
End Sub
Attached Files
File Type: xlsm Number NonBlank Rows.xlsm (15.9 KB, 14 views)
Reply With Quote