+ Reply to Thread
Results 1 to 12 of 12

Case Statement

  1. #1
    Registered User
    Join Date
    04-28-2011
    Location
    Prague
    MS-Off Ver
    Excel 2007
    Posts
    18

    Case Statement

    Hi everyone,

    could you please help me with case statement? I am trying to do some checkings in files, so for example :

    Check if in A2-A6 is something in number)
    B2-B6 is something in (text)
    in cells C1-C6 is "DONE"
    in cells D1-D6 doesnt equal to "N/A"
    in at least one of the cell E1-E6 is "COMPLETED"
    in at least one of the cell F1-F6 is this kind of number format "00.000.000.0/00"

    IF some error, make the cell red

    Check if the filename is in the format : 0000_ZZZ.xls

    Thank you for any ideas

  2. #2
    Registered User
    Join Date
    04-28-2011
    Location
    Prague
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Case Statement

    anyone please?

  3. #3
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Case Statement

    hi, Slaughte, please post sample workbook showing original data and result you need

  4. #4
    Registered User
    Join Date
    04-28-2011
    Location
    Prague
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Case Statement

    thanks for reply, test file attached.

    Check if in A2-A6 is number and is the same for all these fields

    B2-B6 is text and is the same for all these fields

    if Wheel is in column D (d2,d3), then J2/J3 and K2/K3 must be filled too (yellow)

    if Tire is in column D (D4,D5), then E4/E5 must be number in mentioned format, G4/G5 number, H4/H5 has to be filled in (pink)

    if Window is in column D (D6), then G6,F6 (mentioned format) and H6 has to be filled in (blue)

    "I" column must be in the date format

    Check if the filename is in the format : 0000_ZZZ.xls

    If there are some errors, could be the errors highlighted somehow, or some message box in the end saying found 0errors, or found 3 errors......?

    Thank you very much
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-28-2011
    Location
    Prague
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Case Statement

    any ideas? I would be very very grateful..

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Case Statement

    hi, Slaughte, please check attachment, hope this helps.
    PS. I've taken the risk to offer a different way of handling ID and Street columns.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    04-28-2011
    Location
    Prague
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Case Statement

    watersev: thank you so much for this!!!! I just found out that the layout has been changed, so I have tried to change VBA from you, but got in problems with offsets.Conditions are still the same, there was just a movement with columns and some new are there.


    Please Login or Register  to view this content.


    Do you think you could help me with the new and final version of the layout as well?



    I am really sorry for this, I didnt know that in advance...


    Thank you very much
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    04-28-2011
    Location
    Prague
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Case Statement

    and I almost forget, colours dont need to be there anymore. All cells in one colour are fine...

  9. #9
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Case Statement

    please check attachment, run code "test"

    Please thoroughly check LAN acceptable formats.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    04-28-2011
    Location
    Prague
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Case Statement

    thanks again! Weird thing though, it does work in the file attached, but when I try to save it in my personal and use it for other files, then it doesnt.... is there some way, how to do this?

    THank you

  11. #11
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Case Statement


  12. #12
    Registered User
    Join Date
    04-28-2011
    Location
    Prague
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Case Statement

    thanks for this. Actually adding this macro into the personal file is not a problem, but the functionality is. Whenever I put there new data and run a macro again, then it doesnt work.... Could you please help me with that?

    THanks again

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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