+ Reply to Thread
Results 1 to 4 of 4

Auto increment column A

Hybrid View

  1. #1
    Registered User
    Join Date
    09-28-2012
    Location
    boston
    MS-Off Ver
    Excel 2010
    Posts
    42

    Auto increment column A

    Hi guys!

    I have a sheet where when a user types something in column b the sheet auto increments and fills in column A with a unique number. I would like to start the number at 1000 rather than just 1.

  2. #2
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Auto increment column A

    it would be great if you provide sample workbook
    Thanks - Naveed
    -----------------------------
    If the suggestion helps you, then Click * to Add Reputation
    To Attach File: Go Advanced>>Manage Attachments>>Add Files (In Top Right Corner)>>SelectFiles>>.........Locate Your File(s)>>Upload Files>>Done (In Bottom Right)
    1. Use [code] code tags [\code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Auto increment column A

    Can you post the code that you already have?

    FWIW

    This uses a helper cell in this case H1. You would put the 1000 in H1, if it's useful too you.

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Columns(2)) Is Nothing Then
    x = Range("H1").Value
        Target.Offset(, -1).Value = x
    Range("H1").Value = x + 1
    End If
    End Sub

  4. #4
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Auto increment column A

    try this code :

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column = 2 And Target.Text <> "" Then
    Range("a" & Target.Row) = 999 + Target.Row
    Else
        If Target.Column = 2 And Target.Text = "" Then
        Range("a" & Target.Row).Clear
        End If
    End If
    
    End Sub
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

+ 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. auto increment merged column by 1
    By matrix_xrs in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-05-2013, 10:34 AM
  2. Auto increment ID
    By Jakes in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-21-2012, 06:32 AM
  3. Auto increment Rows Number in a column using VB
    By chancw in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-04-2012, 01:28 PM
  4. vlook up increment column number with auto fill
    By martindwilson in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-20-2007, 12:37 PM
  5. [SOLVED] DP Auto increment
    By Waikato300zxClub@gmail.com in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-15-2006, 07:40 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