+ Reply to Thread
Results 1 to 9 of 9

macro code for adding a cell in left of original cell?

Hybrid View

gkeith macro code for adding a cell... 07-28-2010, 02:27 PM
blane245 Re: macro code for adding a... 07-28-2010, 03:53 PM
gkeith Re: macro code for adding a... 07-29-2010, 12:45 PM
jaslake Re: macro code for adding a... 07-28-2010, 03:55 PM
gkeith Re: macro code for adding a... 07-29-2010, 12:37 PM
jaslake Re: macro code for adding a... 07-29-2010, 12:40 PM
gkeith Re: macro code for adding a... 07-29-2010, 12:47 PM
  1. #1
    Registered User
    Join Date
    05-26-2010
    Location
    Northern Virginia
    MS-Off Ver
    Excel 2007
    Posts
    28

    Post macro code for adding a cell in left of original cell?

    Is there any macro code for automatically adding a cell with ID number on the left next to name by following the list on ID sheet. Look at my attached sample for more understanding. I need a way to assign each person's ID next to their name matching the listed on ID sheet with ID and name on it so I can develop a VBA macro to do what I need.

    Thanks!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: macro code for adding a cell in left of original cell?

    I you flipped the two columns on the ID sheet (name then ID), you could use the vlookup function to find the ID for each name.
    Bob
    Click my star if my answer helped you. Mark the thread as [SOLVED] if it has been.

  3. #3
    Registered User
    Join Date
    05-26-2010
    Location
    Northern Virginia
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: macro code for adding a cell in left of original cell?

    Quote Originally Posted by blane245 View Post
    I you flipped the two columns on the ID sheet (name then ID), you could use the vlookup function to find the ID for each name.

    Can you explain step to step how to do this? I tried vlookup and I do not really understand how it works. Thanks.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: macro code for adding a cell in left of original cell?

    Hi gkeith

    Do you want this done on both sheet1 and sheet2? Or are the two sheets merely two different examples? If you want it done on both sheets, is there a reason data starts on line 3 in sheet 1 and on line 2 in sheet 2?

    John
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Registered User
    Join Date
    05-26-2010
    Location
    Northern Virginia
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: macro code for adding a cell in left of original cell?

    Yes, I want it to be done on both sheet 1 and 2 using the listed ID number for each person. Is there any way for this? Thanks.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: macro code for adding a cell in left of original cell?

    Hi gkeith

    Yes, there is a way for this to be done. What about this question
    is there a reason data starts on line 3 in sheet 1 and on line 2 in sheet 2?
    Is that the way the data exists in your actual worksheets? Just curious.

    John

  7. #7
    Registered User
    Join Date
    05-26-2010
    Location
    Northern Virginia
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: macro code for adding a cell in left of original cell?

    Quote Originally Posted by jaslake View Post
    Hi gkeith

    Yes, there is a way for this to be done. What about this question

    Is that the way the data exists in your actual worksheets? Just curious.

    John
    It is employee's ID listed on third sheet. I want to add ID next to name on all 28 sheets without manually IDing them each. That would be forever with 100 employees on the actual excel worksheet. Thanks.

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: macro code for adding a cell in left of original cell?

    Hi gkeith

    You haven't answered my question.

    You have three worksheets. In sheet 1, the data starts in row 3. In sheet 2, the data starts in row 2. I'm not concerned with where the data starts in ID worksheet.

    You indicate you have 28 sheets in which to add the ID. Does the data start in the same row in all 28 sheets or does it vary from sheet to sheet?

    If it varies from sheet to sheet, I need to be able to "find" a starting point. For example, one could "look for" the header "Name" and hopefully assume that the names start immediately below this header.

    Let me know what I'm dealing with.

    John

+ 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