+ Reply to Thread
Results 1 to 3 of 3

how to number in vba

  1. #1
    Registered User
    Join Date
    07-05-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    51

    how to number in vba

    Basically what code would I use to add numbers to data, for example. if I add 10 rows of data in column A. how would I number it in column b 1 to 10.
    But what I also really what with it is for the code to be able to deal with different numbers of rows. for example, on one day I might have 5 rows of data so I want it to number 1 to 5. but the next day I might have 20 rows of data so I want it to number 1 to 20. cheers guys.

  2. #2
    Registered User
    Join Date
    07-05-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: how to number in vba

    this is what i want to do

    a1 b1

    a 1
    aa 2
    a 3
    a 4
    a 5
    a 6

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485

    Re: how to number in vba

    quick and dirty. Select the range in column B opposite the values in column A.
    ALT+F11 to get to VBE
    CTRL+G to get to immediate window
    Enter the following 2 commands

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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