+ Reply to Thread
Results 1 to 6 of 6

Adding numbering to seleceted cells

  1. #1
    Registered User
    Join Date
    08-16-2012
    Location
    holland
    MS-Off Ver
    Excel 2007
    Posts
    27

    Adding numbering to seleceted cells

    Hello,

    I have a excel sheet where i am listing a lot of numbers, and i want to make a button that will automatticly number my selection.
    but there is also another number in that cell

    so if i would select A3:A10 it whould have the original number and -1 -2 etc
    so this i what it should look like afther the command button is clicked:
    1-1
    1-2
    1-3
    1-4
    etc

    where i would have already entered the 1 in every cell.
    I know how to create the buttons etc i just need help with the code.

    thanx in advance

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,517

    Re: Adding numbering to seleceted cells

    Maybe something like this.

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    08-16-2012
    Location
    holland
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Adding numbering to seleceted cells

    It almost works except for it only takes the numbers 1 3 5 7, this probally has to do with the i = i + 1 where it takes 1 and for the second time i + ( i + 1) but i do not know how to fix this myself

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,517

    Re: Adding numbering to seleceted cells

    Can you upload your workbook? And tell what cell you are selecting thats giving you a problem?

  5. #5
    Registered User
    Join Date
    08-16-2012
    Location
    holland
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Adding numbering to seleceted cells

    Could it be becouse the first coulomb are 2 merged colloms? i have to keep the combined, is there any way to change to code so it works?
    Last edited by hoimae; 08-16-2012 at 08:12 AM. Reason: I saw someting on my sheet

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,202

    Re: Adding numbering to seleceted cells

    Excel will interpret 1-1 as 01-Jan. So

    Please Login or Register  to view this content.
    Edit: Just seen the comment about Merged Cells. Remove them they will cause problems & use Center Across selection instead
    Last edited by royUK; 08-16-2012 at 08:17 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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