+ Reply to Thread
Results 1 to 4 of 4

Excel Macro, VBA help needed - Insert Cell based on value of a cell in another column

  1. #1
    Registered User
    Join Date
    11-29-2012
    Location
    New York, NY
    MS-Off Ver
    Excel 2013
    Posts
    15

    Excel Macro, VBA help needed - Insert Cell based on value of a cell in another column

    Hello all,

    I would like to write a macro that will insert a cell in a column based on the data value of another cell in another column. My table has values in columns A-T, however, for these purposes, I only care about the values in column C and G.

    If a value in Column C = "AA", "BB", or "CC", i would like a cell to be inserted into that row, in column G (shift the cells down). The table has varying number of rows from time to time, but columns dont change.

    Before macro is run, the table looks like this...

    A B C D E F G
    1 A AA 1 A 1 A
    2 B A 2 B 2 B
    3 C B 3 C 3 C
    4 D C 4 D 4 D
    5 BB 5 C 5 E
    6 E 6 6 F


    Desired result for table, after macro is run....
    A B C D E F G
    1 A AA 1 A 1
    2 B A 2 B 2 A
    3 C B 3 C 3 B
    4 D C 4 D 4 C
    5 BB 5 5
    6 E 6 6 D
    E
    F


    I have attached a file displaying the example above.

    Your help is greatly appreciated.

    AW
    Attached Files Attached Files

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Excel Macro, VBA help needed - Insert Cell based on value of a cell in another column

    this looks like it should work....if I understood what you wanted...

    I wasn't sure if you were just looking for "AA","BB","CC" or anything that had double letters....

    Please Login or Register  to view this content.
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Registered User
    Join Date
    11-29-2012
    Location
    New York, NY
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: Excel Macro, VBA help needed - Insert Cell based on value of a cell in another column

    Thanks, judgeh59! Your solution is exactly what I was looking for.

    AW

  4. #4
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Excel Macro, VBA help needed - Insert Cell based on value of a cell in another column

    sweeeeeeeeeeeeeeeeeet.....glad I could help....

    EDIT: And thanks for the REP!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Excel Macro to Insert/Copy a row based on a cell value
    By gdamato in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-06-2013, 07:09 PM
  2. Insert Images to Cell Column A based on Cell Value in column B
    By fyremaster in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-22-2013, 06:25 PM
  3. macro needed: change cell colour based on input in another column
    By weesteev in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-23-2012, 02:47 PM
  4. Need Help w/Macro That Will Insert Column Based on Specific Text in a Given Cell
    By pb6933944 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-23-2012, 12:23 PM
  5. Insert pictures into cell macro help needed!
    By Crüe in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-08-2011, 02:01 AM

Tags for this Thread

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