Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-08-2018, 04:40 PM
Logit Logit is offline Auto Numbering of data except blanks starting from number n Windows 10 Auto Numbering of data except blanks starting from number n Office 2007
Expert
 
Join Date: Jan 2017
Posts: 591
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 the updated macro :

Code:
Option Explicit

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

    For Each x In Range("B5:B100")  '<-- Edit range as required.
    
        If IsNumeric(x.Offset(0, -1).Value) And x.Offset(0, -1).Value > 0 Then
            i = x.Offset(0, -1).Value
        End If
       
        If x <> "" Then
            If x.Offset(0, -1) = "" Then
                x.Offset(0, -1) = i
                i = i + 1
            End If
        End If
        
    Next
End Sub
Attached Files
File Type: xlsm Number NonBlank Rows (1).xlsm (18.8 KB, 10 views)
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Numbering of data except blanks starting from number n Return Multiple values from data except blanks with two criteria Marcia Excel 7 09-07-2018 12:38 AM
Auto Numbering of data except blanks starting from number n Delete starting number *) and delete Unneeded data in series frustrated teacher Word VBA 5 12-07-2014 06:53 PM
Auto Numbering of data except blanks starting from number n Starting page numbering after initial pages plradoff Word 3 02-15-2014 08:59 PM
Auto Numbering of data except blanks starting from number n Copying data from sheet with deleted columns creates blanks ZGreyArea Excel 1 11-20-2013 10:12 AM
Auto Numbering of data except blanks starting from number n Page numbering starting on 2 after section break pamm13 Word 1 06-22-2011 11:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:42 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft