+ Reply to Thread
Results 1 to 8 of 8

Macro is inserting cells in one column, need it to insert in 2nd column as well

  1. #1
    Registered User
    Join Date
    05-31-2012
    Location
    PA
    MS-Off Ver
    Excel 2007
    Posts
    53

    Exclamation Macro is inserting cells in one column, need it to insert in 2nd column as well

    I have a macro that is comparing column A to column B and where B does not match A it is inserting a cell and moving the other cells down a row so that the values match again. I have descriptions in column C that i need to move along with column B. Is there a macro for this?

    Thanks so much!

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Macro is inserting cells in one column, need it to insert in 2nd column as well

    Why dont you post your macro here? We can edit it for you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Contributor
    Join Date
    01-20-2012
    Location
    Amsterdam, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    186

    Re: Macro is inserting cells in one column, need it to insert in 2nd column as well

    sounds like you could do something simulair with a vlookup function?
    Can you post an example?

  4. #4
    Registered User
    Join Date
    05-31-2012
    Location
    PA
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Macro is inserting cells in one column, need it to insert in 2nd column as well

    Here is my macro. It is comparing values in row P with values in row F. When P does not match F... It is inserting cells and shifting cells down in Row P until they match F again. Row Q has a description in it. I just want Q to move down with the value that also moves in P. How do I add this?
    THANKS!!!!
    Please Login or Register  to view this content.
    Last edited by arlu1201; 06-01-2012 at 09:39 AM. Reason: Please use code tags in future.

  5. #5
    Forum Contributor
    Join Date
    01-20-2012
    Location
    Amsterdam, The Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    186

    Re: Macro is inserting cells in one column, need it to insert in 2nd column as well

    What about adding this in for example columns R and S:

    R1 = F1
    S1 = Vlookup(F1; P:Q; 2; False)

  6. #6
    Registered User
    Join Date
    05-31-2012
    Location
    PA
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Macro is inserting cells in one column, need it to insert in 2nd column as well

    No that isn't working. Column Q doesn't relate to F. It is just wording that needs to stay aligned with the values that are in column P.

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Macro is inserting cells in one column, need it to insert in 2nd column as well

    Try changing this line
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-31-2012
    Location
    PA
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Macro is inserting cells in one column, need it to insert in 2nd column as well

    This worked!!!!!!!!!!!!! YES!!!!!! I just jumped out of my seat! hahaha! Thank you so so so so much!!!

+ 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