+ Reply to Thread
Results 1 to 5 of 5

Generate Value based on another cells value and the row number

  1. #1
    Registered User
    Join Date
    06-12-2010
    Location
    Hereford, England
    MS-Off Ver
    Excel 2003
    Posts
    73

    Generate Value based on another cells value and the row number

    Hi all,

    A Quick one. I have a database of around 3000 names. I want a macro that will populate column N with the value of Column B & the row number.

    For example, lets say John Smiths details are on row 48. The surnames are in column B so column N value would be "smith48".

    Anyone know how to achieve this?
    Last edited by Baziwan; 01-25-2013 at 09:40 AM.
    Kind Regards

    Baz

  2. #2
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Generate Value based on another cells value and the row number

    Hi Baz
    At its simplest something like this - add your sheet name and data start row as appropriate

    Please Login or Register  to view this content.
    If this was helpful then please click the small star icon at the bottom left of my post. A little appreciation goes a long way.

  3. #3
    Registered User
    Join Date
    06-12-2010
    Location
    Hereford, England
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: Generate Value based on another cells value and the row number

    Hi Barry,

    That does exactly what I asked for, thanks. Can I trouble you for an addition. Can I force the value in lowercase and remove the space between the value and the row number?

  4. #4
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Generate Value based on another cells value and the row number

    Baz
    I'm a bit puzzled by your request - there is no space between the value and the number.
    If you want one (and for lowercase) make the small amendment shown.
    If you don't want the space remove the red code snippet.

    Please Login or Register  to view this content.
    If this meets your requirement please mark your thread as SOLVED
    barry

  5. #5
    Registered User
    Join Date
    06-12-2010
    Location
    Hereford, England
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: Generate Value based on another cells value and the row number

    Hi Barry,

    The spaces were generated in my database. For some unknown reason when the database was exported to excel, the surnames all had a space after them. This was why I was getting a space between the surname and the row number. I solved it by using the
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    formula to remove the spaces.

    Anyway, thanks for all your help

+ 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