+ Reply to Thread
Results 1 to 4 of 4

Check a cell's value and populate other cells with varying data

  1. #1
    Registered User
    Join Date
    05-03-2010
    Location
    Texas, US
    MS-Off Ver
    Excel 2003
    Posts
    4

    Check a cell's value and populate other cells with varying data

    I have a spreadsheet with a column that has text, I need it to check to see if another column in the same row has text in it, then fill other cells in the same row but different columns accordingly.

    Basically a while loop with a case statement for each check, and the while loop tests if the cell has a value in it before processing, when it reaches the end of the data it stops, there will never be a blank cell before the end of the column.
    Please Login or Register  to view this content.
    B2 will be a number(text?) that will change with each sheet, but each time I run the macro it will be using the number from that cell on that sheet, and it's giving me problems.
    I know this code isn't exact, but I was doing it at work and I forgot to bring it with me, so this is a basic sketch of what I am working with.

    ..........A..........B.........C.........D........E.........F..........G
    1
    2...................90-91
    3....................Box.....System
    4...................Junct....Transf
    5....................Box.....System

    To become

    ............A............B.........C.........D.............E.........F..........G
    1
    2.....................90-91
    3..90-91.Box.....Box...System....Virtual....Place1.....Place2......
    4.....................Junct...Transf
    5..90-91.Box.....Box...System....Virtual....Place1.....Place2......

    It will always start at the same row+column, but it needs to go until it runs out of stuff in the column
    Last edited by Demosthenes&Locke; 05-05-2010 at 07:27 AM. Reason: Code tags required for VBA Code, Please read the Forum Rules

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Help with macro to check a cells value and populate other cells with varying data

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  3. #3
    Registered User
    Join Date
    05-03-2010
    Location
    Texas, US
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Check a cell's value and populate other cells with varying data

    I ended up fixing it on my own.
    Last edited by Demosthenes&Locke; 05-05-2010 at 07:28 AM.

  4. #4
    Registered User
    Join Date
    05-03-2010
    Location
    Texas, US
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Check a cell's value and populate other cells with varying data

    Solution:
    Please Login or Register  to view this content.
    I would have liked to have done it with a while statement, and used the method of activesheet.cells to control the cells so I could have used a variable without having to use an offset, and I would have preferred a case statement, so if anyone can write one to do it that way and verify it is working, please post it here for the archive.
    Last edited by Demosthenes&Locke; 05-05-2010 at 07:39 AM.

+ 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