+ Reply to Thread
Results 1 to 16 of 16

If number in culumn 'A' match set number another number in column 'I'

  1. #1
    Registered User
    Join Date
    03-30-2011
    Location
    Swansea
    MS-Off Ver
    Excel 2007
    Posts
    72

    If number in culumn 'A' match set number another number in column 'I'

    A series of numbers are inserted into the cells in column 'A' - if say cell 'A1' number matches a number (in the code) a different number is inserted into the cell in column 'I'.......

    ie
    When any cell in column A containes 4505 the number 194069 is placed into column I
    When any cell in column A containes 4513 the number 194079 is placed into column I
    When any cell in column A containes 4521 the number 194089 is placed into column I
    When any cell in column A containes 4548 the number 194099 is placed into column I

    and then once finished the data in column A is cleared
    Last edited by MAButler; 04-11-2011 at 02:13 AM.

  2. #2
    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: If number in culumn 'A' match set number another number in column 'I'

    Hi MAButler

    How many numbers we talkin' 'bout here? Less than 10? More that 50? Somewhere in between?
    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.

  3. #3
    Registered User
    Join Date
    03-30-2011
    Location
    Swansea
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: If number in culumn 'A' match set number another number in column 'I'

    Column 'A' could have any number of cells of data, but that data will allways be one of the folowing numbers 4505, 4513, 4521 or 4548........

  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: If number in culumn 'A' match set number another number in column 'I'

    Hi MAButler
    You could try this sheet change code
    Please Login or Register  to view this content.
    Let me know of issues.

  5. #5
    Registered User
    Join Date
    03-30-2011
    Location
    Swansea
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: If number in culumn 'A' match set number another number in column 'I'

    That works on the input sheet........ Thanks - If the inputter deletes the cell how can i amend the code to delete th entry in column I........ I think just add another case line with " "???

    But what i would like to do is insert the code into a a code I have written to extract data from the input sheet - so when the data gets to the new sheet its there.........

    So the question is how to compine two seperate codes.......

    Please Login or Register  to view this content.

  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: If number in culumn 'A' match set number another number in column 'I'

    Hi MAButler
    You are correct
    just add another case line with ""
    Please Login or Register  to view this content.
    I don't understand this
    extract data from the input sheet - so when the data gets to the new sheet its there.........
    If the user has input the requisite numbers in column A of this sheet, column I of this sheet will be populated accordingly. When you extract data from this sheet to another sheet, the information will be there in the new sheet. I sense I'm missing something...what is it? What's the process?

  7. #7
    Registered User
    Join Date
    03-30-2011
    Location
    Swansea
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: If number in culumn 'A' match set number another number in column 'I'

    Sorry so long coming back........ the Sun has finally come out in Wales, and I have escaped this project...... but hey.... I am back

    Firstly the code works very well, I have a few questions......

    1. Say I have "4505" typed in Cell C5 and "194069" typed in Cell C6 on the second sheet in the workbook called "INFO", could the code pick from there rather than be hard typed in the code? It would be easier to change if the Accounts change.....

    Case "4505"
    Target.Offset(0, 8).Value = "194069"

    2. If the above could be done then I could have a input box when you first open the file. That would ask the name of the inputer, then put that into say Cell C2 on "Info" sheet, then your code could pick from there and then input it on the "Data" sheet Column "H" when say "4505" is keyed in. The less typed in the quicker.

    3. If the inputter makes an error and then has to delete "4505", is there a code to delete the content in the cells on the same row Column H and I.

    On to the bit you did not understand....... What i ment is if i did not use the code on the input sheet could it be joined into the code i have been working on to extract data....... dont worry if i can get it to do the above it will be fine.......

  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: If number in culumn 'A' match set number another number in column 'I'

    Hi MAButler
    The Wales sun must have fried my brain as I understand nothing of this
    if i can get it to do the above
    I'm certain there are others on the Forum that can look at your description and say "AHA, I know what MAButler is looking for". Doesn't do that for me...have no clue.
    I'm glad to help. Perhaps if you posted a workbook that demonstrates what you have and what you'd like it to be...I may be able to help.

  9. #9
    Registered User
    Join Date
    03-30-2011
    Location
    Swansea
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: If number in culumn 'A' match set number another number in column 'I'

    I have uploaded the file.........
    Attached Files Attached Files

  10. #10
    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: If number in culumn 'A' match set number another number in column 'I'

    Hi MAButler

    I've looked at your most recent workbook attachment and have some questions.

    Firstly
    I'd appreciate it if you'd describe your process to me so I'm not guessing which is the chicken and which is the egg. I'm happy to help but unless I understand the steps, it's difficult for me to envision what you want and/or where you want it. Having said that, these are my observation based on my review of your file:

    Secondly
    It APPEARS that Sheet Info is a data entry sheet.
    If this is true, then it would appear that, if the user entered 4505 in Sheet Info cell C5, you want Sheet Info Cell C6 populated with 194069, etc, etc.
    If this is true, this code, inserted into Sheet Info will accomplish that
    Please Login or Register  to view this content.
    Thirdly
    It APPEARS that Sheet Data is a repository for all data from Sheet Info.
    If this is true, and Sheet Info IS a data entry sheet, how and where in the process does data get passed from Sheet Info to Sheet Data?

    When, where and how would the user do this
    If the inputter makes an error and then has to delete "4505", is there a code to delete the content in the cells on the same row Column H and I.
    Do you HAVE a form and code in place for the user to make corrections?

    Fourthly
    I can't answer this question
    if i did not use the code on the input sheet could it be joined into the code i have been working on to extract data
    'cause I don't know your process and I don't know what your extract code is.

    MAButler...layout your process...help me understand it...perhaps I can help with solutions. At the moment, I'm in a fog.

  11. #11
    Registered User
    Join Date
    03-30-2011
    Location
    Swansea
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: If number in culumn 'A' match set number another number in column 'I'

    Ok……. Sorry I have been working on this for a while so this would be a good exercise, fresh eyes and all that.

    This is how I would like it to work, some parts are already working and well other parts are I would like.

    A staff member will then type data straight on to the Sheet1 (Data), the first thing they type is the account number (the cell will only accept one of the four listed on Sheet2 (Info)), as soon as they type this number: - the reference , date as in today (but needs to be changeable) and the initials column are populated. (Less typing fewer errors). Hit the enter button and we move across to the right and after column G we move down a line. We have about fifty a day to type in so the data builds up fast, if they type in the same registration or serial number twice or more the cell turns red so they can investigate. There will be a search on Registration, Name or serial number from Sheet2 (Info) extracting all the data rather than taking them to the line as information could be on more than once.
    If the supervisor logs in (at the moment available to all) A monthly report is available (ctrl r) but will also work from a button on Sheet2 (Info), this report extracts information from Sheet1 (Data). It firsts asks for start date, end date and account, then opens new workbook copies the information that matches. Deletes what’s not needed adds what is and then saves to new file name based on account number and month, finally displays a message box giving location and name. (Yes that end bit all works)

    Returns you to original file.”

    That’s it all…………. Its nearly there but not quite…….
    Last edited by MAButler; 04-10-2011 at 08:06 PM.

  12. #12
    Registered User
    Join Date
    03-30-2011
    Location
    Swansea
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: If number in culumn 'A' match set number another number in column 'I'

    Well another problem solved, the list get shorter by the day..thanks for your help

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    03-30-2011
    Location
    Swansea
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: If number in culumn 'A' match set number another number in column 'I'

    Another one fixed only the ones in red left.....

    I have attached the lastest version.
    Last edited by MAButler; 04-11-2011 at 02:13 AM.

  14. #14
    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: If number in culumn 'A' match set number another number in column 'I'

    Hi MAButler

    If you're addressing jaslake, sorry, I'm terribly color blind. Can't see Red (or most colors).
    Give me another clue.

  15. #15
    Registered User
    Join Date
    03-30-2011
    Location
    Swansea
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: If number in culumn 'A' match set number another number in column 'I'

    Now in bold, hope that helps

  16. #16
    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: If number in culumn 'A' match set number another number in column 'I'

    Hi MAButler

    Code in a workbook doesn't carry special formatting. You can color it red, green, purple or blue, bold, italic, underlined what ever you please...it's my experience the formatting is not retained in the code. Could be wrong and have learning to do.

    You CAN do this when you post code on the Forum...not in attachments (my experience).

    I use comments when trying to give a message embedded in code.

+ 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