+ Reply to Thread
Results 1 to 2 of 2

Vba for Autonumber

Hybrid View

Anto_BT Vba for Autonumber 08-20-2016, 04:40 AM
davesexcel Re: Vba for Autonumber 08-20-2016, 08:31 AM
  1. #1
    Forum Contributor
    Join Date
    07-06-2012
    Location
    Bitola,Macedonia
    MS-Off Ver
    Excel 2007
    Posts
    132

    Vba for Autonumber

    Formula: copy to clipboard
    Private Sub insert_Click()

    Dim emptyRow As Long

    emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1

    Cells(emptyRow, 2).Value = NameBox.Value


    I have this VBA code and I wan in A so here
    Formula: copy to clipboard
    Cells(emptyRow, 1).Value =
    to start numbering from 1 and so on

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,526

    Re: Vba for Autonumber

    Sub Number()
        Dim rng As Range
        Dim c As Range, s As String
    
        Set rng = Columns("A:A").SpecialCells(xlCellTypeConstants, 23)
        s = 1
    
        For Each c In rng.Cells
            c.Offset(, 1) = s
            s = s + 1
        Next c
    
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Autonumber
    By NaomiDawn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-29-2013, 05:48 PM
  2. [SOLVED] Trying to autonumber
    By nonstopcrunchy in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 08-29-2013, 02:51 PM
  3. [SOLVED] Autonumber
    By nik7 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-23-2013, 06:50 PM
  4. Autonumber
    By jonnygrim in forum Excel General
    Replies: 2
    Last Post: 07-17-2008, 05:22 PM
  5. autonumber service doc
    By pywhacket in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-23-2007, 05:14 PM
  6. lookup and autonumber
    By rajeshparikh64 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-26-2006, 06:19 AM
  7. Autonumber in a cell
    By Omar Menjivar in forum Excel General
    Replies: 0
    Last Post: 03-10-2006, 08:30 PM
  8. [SOLVED] autonumber
    By Hardy in forum Excel General
    Replies: 4
    Last Post: 11-24-2005, 01:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1