+ Reply to Thread
Results 1 to 8 of 8

Macro to auto fill in cells based on value on different cells

  1. #1
    Registered User
    Join Date
    01-12-2010
    Location
    south bend, in
    MS-Off Ver
    Excel 2000
    Posts
    31

    Macro to auto fill in cells based on value on different cells

    I've got a spread sheet with one tab called "reject codes" full of reject codes, station numbers and descriptions. I have another tab called "defect detail" where I enter the month, date, shift, reject code number, station and description. What I'd like to do is when I enter the reject code in column F in tabe "defect detail" to auto fill in column G (station), column H (description) based on the info from tab "reject codes". I started doing this using a very long nested IF(OR)) statement but the problem is it would get very long and have to copy it down to every cell so I want the macro to do it for every new row in column G & H. Any help would be greatly appreciated!Reject Log.xlsx

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Macro to auto fill in cells based on value on different cells

    Macro isn't needed. Put this in G2 of Defect Detail Sheet

    Please Login or Register  to view this content.
    This in H2 of Defect Detail Sheet

    Please Login or Register  to view this content.
    Just copy down as far as you want within column G and H of Defect Detail Sheet

    *Note: Column A of Reject Codes Sheet will need to have a vaule in each row for it to reference.

  3. #3
    Registered User
    Join Date
    01-12-2010
    Location
    south bend, in
    MS-Off Ver
    Excel 2000
    Posts
    31

    Re: Macro to auto fill in cells based on value on different cells

    thanks! but I don't want to copy down the code. I'm going to be giving this to someone else to input data and don't want to worry about copying down code since I"ll also be locking those columns so they can't change it.

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Macro to auto fill in cells based on value on different cells

    I am not understanding the problem. Copy down the code yourself all the way to the bottom then lock the columns. It will still reference properly when they change the reject code in column F

  5. #5
    Registered User
    Join Date
    01-12-2010
    Location
    south bend, in
    MS-Off Ver
    Excel 2000
    Posts
    31

    Re: Macro to auto fill in cells based on value on different cells

    the problem is i don't want to copy the code all the way down to row 10485476 which is the bottom of a excel 2010 spreadsheet.

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Macro to auto fill in cells based on value on different cells

    Place this in the Defect detail worksheet mod

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  7. #7
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Macro to auto fill in cells based on value on different cells

    small modification to clearcontents

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    01-12-2010
    Location
    south bend, in
    MS-Off Ver
    Excel 2000
    Posts
    31

    Re: Macro to auto fill in cells based on value on different cells

    Thanks Mike!!!!!!!
    It works perfectly!

+ 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