+ Reply to Thread
Results 1 to 75 of 75

Way to Format row if certain text is found in a column.

  1. #1
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Way to Format row if certain text is found in a column.

    I have some information that gets populated on one sheet in Range (A10:E52) Columns (A-E) are merged together:

    What I want is if the text in That row 10-52 in column A = contains Certain text then it would Format the row a certain Way.

    text to match is: (These are Descriptions that get brought through so I would like if they exist to change the format to have a better look.

    Operating/Standby Charges
    Inspections
    3rd Party Tools/Subs
    Miscellaneous Charges
    Core Charges

    example for row 10: if that text is found then format : Column F10:O10 (delete all formulas and formatting and shade the column A grey color and hopefully take the text and Merge the entire row and center text.
    End Format would look like this:

    Please Login or Register  to view this content.
    I just don't know how to look for the 5 categories and then tell it to format the row in this manor.

    Attached sheet and on the job Ticket Tab an example of the ending result is in row 10.

    I would like row (10,12,13,15,16,17) to have the same format as row 10.

    Here is another thing they row #'s change based on the info that gets populated so It would have to look at each line and based on the text know whether to format that way or not.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    HI BDouglas,

    I wasn't sure that you wanted to clear the contents, but you can uncomment that instruction:

    Please Login or Register  to view this content.
    Last edited by xladept; 09-27-2014 at 03:37 PM. Reason: Re-enable events
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Awesome the only thing I did not factor in is that when you do that and change things on the Job Ticket the problem I see is now if you go back into the Daily chgs and make additions you can not have the sheet reset and carry over the changes after the format changed

    IS there a way to maintain the integrity ----Maybe don't merge and clear contents and formats.....I modified it to

    Please Login or Register  to view this content.
    I removed the Merge aspect and tried to make additions to clean up the results. I have included Both sheets Row 10 on Page Format is how I would like the rows to look. This Is what I used - Change font size to 12, grey out the row, , Remove inner borders to help clean up : it seems to look a little better this way.

    You Know this sheet pretty well Is there any thing you would change to make it better?

    I am finding that sometimes it works and sometimes it does not -- When it does not only the first row get the fill color changed
    Attached Files Attached Files
    Last edited by bdouglas1011; 09-28-2014 at 08:05 PM.

  4. #4
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    I was able to use Conditional formatting to get the output the way I wanted it so that looks good now.

    Heres another question:
    I use the Formula to bring in the rows that get data contained with in them and your code matches the date serviced real good and it looks good.

    Is there a way that if a category has no choices used with in the drop down it has then it does not bring in that category which in turn leaves more room for other choices in other category's.
    My Formula I use is
    Please Login or Register  to view this content.
    your code is
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Hi BDouglas,

    Is there a way that if a category has no choices used with in the drop down it has then it does not bring in that category which in turn leaves more room for other choices in other category's.
    I think that I don't understand - aren't your categories preordained by your configuration?

    Are you contemplating a different configuration?

  6. #6
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Yes the Categories will have a predetermined set of drop downs to choose from - At times say for example in the Core Charges category there may be no drop downs selected because there are no Core Charges to be applied.

    What I am wondering is can the code check if any of the drop downs have been selected and if not then when that category would normally show on the Job ticket that it gets omitted since there are no charges being applied for that category.

    That way the Job ticket does not show a category with no Charges.

    i hope this helps explain my quesiton.

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Perhaps if we allocated rows for each category, then we could nail it down?

  8. #8
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    The drop downs following each category are allocated for that category. Do I need to allocate them a different way.

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    I mean allocate them at run time -I'll see if I can come up with something at my end, but the allocation code is yours, so I'll have to hunt for it

  10. #10
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Update: Cancel that I had a major change : The items that we manually input (Comments, tool size, quantity & unit per) to each service would get out of line if we made an addition and everything got either shifted down or up -- then the items we manually inputted would be on the wrong line......So I am moving the necessary data to be filled out onto the Daily chgs tab and then we will have to bring all that data over so everything lines up I will send you what I have so the code can be altered to accomplish this and you have a better Idea what will need to be done. Once I have it done I will resend it to you.

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    OK - but, I'll get back to you

  12. #12
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    OK Here is the New format the sheets are still same it is just the user will input all the data onto the Daily Chgs tab and then that will populate the Job Ticket.

    On the Job Ticket your columns are:

    Services/Tools Provided Including Sale Items = Same as before 'Daily Chgs' Column B
    Tools Provided/Comments = Tools Provided/Comments
    Tool Size = Tool Size
    Dates of Service = Same as you did before
    Quantity = Quantity
    Unit Per = Unit Per
    Price = Rate

    This way it all gets populated and all the Manual information stays with the correct row.

  13. #13
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Wait on my next attachment I am moving the header Info to the same page so they only enter info on one sheet......

    Hopefully you have started yet.

  14. #14
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Ok Sorry Lets go with this one If I make changes it wont alter the columns where the pertinent data is.
    Attached Files Attached Files

  15. #15
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Hi BDouglas,

    I got bogged down with errands today - I may be able to offer something tomorrow

  16. #16
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Thanks I will keep making a few things I can and wait.. Hopefully it will not be difficult for you..again thanks for your help, but this will cover a lot of the things i was trying to accomplish.

  17. #17
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Thanks for the heads-up, I hadn't started

  18. #18
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    I can't tell if I emailed that version last night but it should be pretty close to my last one attached

    Let me know when you get a chance to work on it

    Everyone can't wait to put it to the test

    Thankz

  19. #19
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Here is the latest & greatest hopefully you get a chance to look at it tonight.
    Attached Files Attached Files

  20. #20
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    See next post
    Attached Files Attached Files
    Last edited by xladept; 10-01-2014 at 07:15 PM.

  21. #21
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    I'll look as soon as I get home tonight

  22. #22
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Hey BDouglas,

    Replace that module 4 code with this:

    Please Login or Register  to view this content.
    I think it's this one:Attachment 349103
    Last edited by xladept; 10-01-2014 at 07:17 PM.

  23. #23
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Hey its almost there .... I put the code into Module 4 and it just needs a coupe things moved around.

    1. the rate or price is coming through in the Tool & comments section
    2. the comments did not come through at all.

    So If I could get the 'rate' moved to column N on Job Ticket and then the 'Tools Provided/Comments' placed into Column F on the Job Ticket.

  24. #24
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Sorry but I got into the office and showed how things were coming and they wanted to move some columns around on the daily Chgs tab - with me not really understanding how to manipulate the code I can not make this change myself.

    This is what the columns on the daily chgs tab should match on Job Ticket

    Job Ticket Columns:
    Services/Tools Provided Column (B:F) on Daily Chgs
    Tools Provided/Comments Column (I) on Daily Chgs
    Tool Size Column (J) on Daily Chgs
    Dates of Service You Know this one already
    Quantity Column (K) on Daily Chgs
    Unit Per Column (G) on Daily Chgs
    Price Column (H) on Daily Chgs
    Total Nothing its a formula that calculates on Job Ticket

    Thanks Again

  25. #25
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Hi BDougas,

    Sorry for the delay but a client had some concerns

    Please Login or Register  to view this content.

  26. #26
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Hi BDouglas,

    Thanks for the rep!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  27. #27
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    I am sorry but they wanted to add a piece of code that looked for duplicates and prevented the user from choosing a duplicate from the drop downs.

    The code that got inserted actually also inserted a row at (67) and it uses the color variation ion the code to stop duplicates form happening.

    Once I started trying it out I got a error on line saying object variable or with block variable not set
    ( lc = wd.Rows(8).Find("tot", MatchCase:=False).Column - 1 )

    I tried making a couple changes but I could not get to work right.

    What change do I need to make for this to work correctly now?

    Also if you have a better way to prevent duplicates please let me know.

    I attached the worksheet
    Attached Files Attached Files

  28. #28
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    I had help with the duplicate code to change it and not alter the sheet but I still get this error from Module 3 where your code is.



    It gives me 'Object variable or With block variable not set'
    ( lc = wd.Rows(8).Find("tot", MatchCase:=False).Column - 1 )

    on that same line

    here is the sheet - I cant figure out on my own

    I don't get the error when the duplicate code is not added for the change event on the sheet
    Attached Files Attached Files

  29. #29
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    I don't get it! Were you getting duplicates? And, does the book you sent me include that code? It runs fine for me

  30. #30
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    I may have sent the wrong sheet...I will reattach

    I wanted to prevent the user from choosing a duplicate from the drop down lists on the sheet in column B.

    Some of our field hands have used the same drop down twice in the past...I wanted to prevent that from happening.

    If you open and go under column B - choose the drop down in row 14 column B & choose "Directional Operating Rate (No MWD)" Which has already been used in row 10-

    The code prevents them from doing this.

    But then with that code running if you go to the job ticket sheet you will get the error I described.....

  31. #31
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    I just tried running the sheet if you actually had 2 of the same drop downs chosen and when you do it does not populate the Dates serviced properly on the Job Ticket page

    Daily Chgs tab - row 11 has Directional Driller Engineer - Per Day, Per Man
    Duplicate that same choice on on Row 14 and you will see that the dates serviced get missed when it populates the Job Ticket Page.

    You will have a blank on row 13 on the Job Ticket and only the Dates of service will be on line 15


    since there are 2 drop down with the same description when it populates the dates one of the dates of service gets left out.

    That is why I wanted to prevent the user from being able to have the same selection twice.
    Attached Files Attached Files

  32. #32
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    That was freaky - try this:

    Please Login or Register  to view this content.
    Yeah, when we use the dictionary the way we did - duplicates don't work

  33. #33
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Hi BDouglas,

    You write a lot of code - I don't think that you're inferior to me in any way!

    Thanks for the rep!

  34. #34
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Okay, Again I found an issue and it has to do with the duplicate code. I had to add a row at 67 on the daily chgs tab and the duplicate code uses the color formatting for its range now. The other Range I used would make the message a duplicate was used everytime.

    Now the duplicates is working at 95% (the problem it has is that if the user clears out data using Clear content or delete I get a error type Mismatch - I dont want the error)

    but now when I go to populate the Job ticket I get a runtime error 1004 we cant do that to a merged cell .......pointing to line

    Please Login or Register  to view this content.

    Can you make a change for this to happen properly?

    Or better yet can you write a code that will do the same for looking for duplicate entries in column B and prevent them from happening. It seems that everytime I get one working it has an issue with the other one.

    I would rather not have the row 67 on the Daily Chgs tab Because I just have to reduce it to a row hgt of '1' so not to see it for the duplicate to work - Hiding it prevents the code form working in the last grouping.

    Here is the revised sheet
    Attached Files Attached Files

  35. #35
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Change that line to:

    Please Login or Register  to view this content.
    And, I trimmed your Daily Chgs Event Code:

    Please Login or Register  to view this content.
    It runs without row 67 now
    Last edited by xladept; 10-07-2014 at 03:02 PM.

  36. #36
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    I tried a change of
    Please Login or Register  to view this content.
    I changed from -1 to -2 and now it seems to be working.....I also got the type mismatch to correct also I added

    Please Login or Register  to view this content.
    Everything seems to be working for now....thanks again

  37. #37
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    You're welcome!

  38. #38
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Here is a new one-- we have software that our guys run all day long in the field.


    It changes the Regional date setting from (mm/dd/yyyy) to (yyyy/MM/dd) which throws off the "Dates of Service" on the Job ticket when they Come thru.

    Usually the dates look like (09/12-09/21) after populating on the Job Ticket
    Now they Show (2014/09-2014/09)

    Can you update the code for this other format so the dates come thru properly.

    Please Login or Register  to view this content.

  39. #39
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    If it's on the Daily Changes then perhaps:

    Please Login or Register  to view this content.
    If that doesn't help, I'll need to see what you're dealing with

  40. #40
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Okay Here is the Problem you don't have the software to run this scenario to recreate the situation so I am going to do my best and explain.

    Look at the Snapshots I attached there are 4 of them

    1. As long as you do not have this software running on your laptop your Region & Language settings remain the way you have them (EX: PIC 1)
    1A. this is how the output looks correctly on the Job Ticket (EX: PIC 2)

    2. When you have the software running (EX: PIC 3)
    2A. This is how it looks with the program running (EX: PIC 4)

    We need the date that comes thru in column I:K on the job Ticket to have (Month/day) for its date ranges (09/12-09/21) Not (2014/09-2014/09)

    This software is almost always running that is the problem

    Can we just modify so it will always Show Month/Day no matter what the regional settings reflect
    Attached Images Attached Images

  41. #41
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    I don't know if you were able to understand what it is doing, But I added a macro that would reformat your region setting on your computer to the dates would come thru Correctly. I can use this until I get a way to format the code to let it come thru correctly when that software adjusts the short date setting.

    Here is the code I used
    Please Login or Register  to view this content.

  42. #42
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    I do have another issue: I had to add another row to the Daily Chgs tab at Row 8 which in turn pushed everything down a row and now my job ticket wont populate.

    I have attached the sheet I am not sure what all to alter on the (NewDateRange in Module PopulateJobTicket)

    Please Help.
    Attached Files Attached Files

  43. #43
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    It is giving me Invalid Procedure call or argument on line
    Please Login or Register  to view this content.

  44. #44
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Try this:

    Please Login or Register  to view this content.
    *Check out my motto

  45. #45
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Hi BDouglas,

    I commented that line out in my last posting - but, the reason for that failing was that the row that determines the dates was still set to 5 rather than row 6 where it is now.

  46. #46
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    It appears to be working I will have to test it out this week end...

    Also If you could please when get time could you go thru and comment through the code So I can make changes when these things come up (Adding and removing Rows/columns) ...that way if you are not around I can figure it out on my own.

    Thank you

  47. #47
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    ?

    Please Login or Register  to view this content.

  48. #48
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Sorry, here is one more thing I would like to add if possible On the Daily Chgs Tab ...you know how we have 6 Categories with independent drop down in each.

    Right now if there is nothing chosen in a category then when it brings everything over it brings that category title with nothing under it. I have added a NONE choice into the drop downs that works to help it look better on the Job Ticket once it is populated.

    What I would like to have happen is if there is nothing in that range Below each title then it would omit that category title to not show on the Job Ticket page.

    Is this possible.
    Attached Files Attached Files

  49. #49
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    I am not sure if you saw my post from yesterday -- I am just not sure if that is a possibility, Just let me know.

    But I was running a test on the final sheet and I am not sure what changed over time but when I only have one entry in certain columns on Daily Chgs & when it pulls the date through it is not populating correctly.

    I attached sheet so you can see the issue look at the job ticket the way it formats if only there is one date to list under the date range.

    Remember Financial3 is protection PW
    Attached Files Attached Files

  50. #50
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    I put back in the code below from an earlier version and it is working I just commented the other out so you could see.....I gather this is ok and wont pose any problems.

    Could you let me know if this is OK and what I asked about yesterday on leaving a category out if nothing chosen with in that range?



    Please Login or Register  to view this content.

  51. #51
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Hi BDouglas,

    You can't do one thing - this code will omit the category title, but, if there is a non-contiguous entry in that category, it will post without the category title

    Please Login or Register  to view this content.
    Red code fixes the category title issue, blue code the date issue
    Last edited by xladept; 10-14-2014 at 02:58 PM.

  52. #52
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    The new code to prevent not bringing in category's header has been working and then I noticed a glitch when putting it though a test run ....Please see sheet you will notice that I have filled in the first 2 category's completely but I do not have anything in the 3rd party tools and subs - Then when I checked my progress on the Job Ticket I noticed that the Category description is coming through for 3rd part tools....There is nothing in that category range but it still brings it in.

    If you remove the data in the line directly above the Category description then it omits the Category description, but if the previous category has any info in the last row of its section it allow the description to populate.
    Last edited by bdouglas1011; 10-16-2014 at 11:30 AM.

  53. #53
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    I just realized that the cell above is a bordering cell so do you think I should try to add a blank line but reduce it above each category that way it wont think it is filled in...or do you have a better solution

  54. #54
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Hey BDouglas,

    That book doesn't run at all - does it run for you? Please post another book as I can't use this one - I wonder what happened?

    Have you done something with the API??

  55. #55
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    It open right up for me I am not sure why ...I have re-saved and reattached

    Let me know if this works
    Attached Files Attached Files

  56. #56
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Hi BDouglas,

    do you think I should try to add a blank line but reduce it above each category that way it wont think it is filled in...or do you have a better solution
    I don't have a better solution yet - what I've done is messy and creates future problems that will need to be dealt with - adding a blank line is the easiest thing to do for the moment.

    There was, in the VBA references, a line that said Missing stuff - I unchecked that and it finally ran.

    I'll be thinking about this blank line problem and if I come up with a viable solution, I'll post it

  57. #57
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    I have added the blank Lines and Hidden them and the sheet is populating OK I just had to changes some ranges but if you come up with anything lease let me know but seems to be working for the most part once I finish changing everything

  58. #58
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Hi BDouglas,

    I may have solved this issue and, hopefully, haven't created another I added another index for the resizing:

    Please Login or Register  to view this content.

  59. #59
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    I'll try it at home tonight I'll let you know

  60. #60
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    I just got thru testing it out & I thought it was working but then I filled in entire sheet and verified it populated job ticket correctly then I omitted a Category by clearing all its data and went back to Job ticket.

    It actually omits the last drop down choice in the section just above the category when it populates the Job ticket

    It has 2 blank lines where the category would usually go. I assume that would be for the line that is omitted and the category line that it does not show.

    I attached the sheet so you could see what I did.
    Attached Files Attached Files

  61. #61
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    I hope I was careful enough this time:

    Please Login or Register  to view this content.

  62. #62
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    All right I just got it copied and after running the test the only thing I see is the range does not capture the last Column on the daily chrgs sheet. If you
    actually have the last column checked then it will not populate the job ticket on that line....

    Look at column BU and notice the spots that don't have a "1" in them they are the ones that come through on the Job ticket....the one with the "1" don't show any dates once you populate the Job Ticket.

    I attached the file so you can see it
    Attached Files Attached Files

  63. #63
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Hi BDouglas,

    Please Login or Register  to view this content.

  64. #64
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Everything is going great I would like to add one more change and it should not be very hard to do.

    In (A7) of the Job Ticket right now I have it showing the start Date.
    What I would like to show is the Period Covered on the Job.

    The Start Date is in Cell (A6) of the 'Daily Chgs' Tab right now.

    What formula would I use to actually grad the start date & the last date that any activity was generated on.

    Example for the sheet I have attached the Period Covered is ( 09/12/14 - 11/12/14 )

    What would I need to use to reflect this range in that Cell (A7).
    Attached Files Attached Files

  65. #65
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Hi BDouglas,

    The routine I've added is in bold red:

    Please Login or Register  to view this content.

  66. #66
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    You're welcome and thanks for the rep!

  67. #67
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Believe it or not this is the first problem one of my hands had today after trying to get the sheet filled out.

    When it goes to populate the Job Ticket it got an invalid procedure or call on Line,
    If DS <> "" Then DS = Left(DS, Len(DS) - 2)

    The only thing I could see is they did not have any thing filled out in the Comment section and no dates which happens from time to time:

    After I filled in some comments the invalid procedure went away and it populated.

    Also when it hung up and did not follow through with the procedure The sheet had been unlocked during the Macro but then when it Messed up... it left the sheet unprotected ....And inadvertently the guy started playing around with it trying to get it to work and no idea what he was doing.

    So is it possible when the Macro Hangs up at any time can it automatically Lock the sheet for this not to happen.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  68. #68
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Hi BDouglas,

    Try:

    Please Login or Register  to view this content.
    Last edited by xladept; 11-01-2014 at 07:50 PM.

  69. #69
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    What did you find that was happening? And were you able to add a way that if it stops the macro for some reason it would still keep the destination sheet locked.

  70. #70
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Since the I column was null, the resizing index was skipping a data row - I forgot to add the error code

  71. #71
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Hi B,

    I edited the code - see the red

  72. #72
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Thanks ONCE AGAIN

  73. #73
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    You're welcome again - I should probably enhance that error code - maybe later

  74. #74
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Houston, TX
    MS-Off Ver
    office 365
    Posts
    638

    Re: Way to Format row if certain text is found in a column.

    Let me know if you enhance the error code so I can update the ones that I have already using this in the field.

    thanks

  75. #75
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Way to Format row if certain text is found in a column.

    Of Course!

+ 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. Replies: 10
    Last Post: 12-12-2013, 02:27 AM
  2. Replies: 3
    Last Post: 10-25-2012, 12:49 AM
  3. [SOLVED] search column for text, if found, paste value in a different column in new sheet
    By wkarnadi in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-17-2012, 10:29 AM
  4. ColorIndex with VBA in column until text is found
    By Ironman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-18-2011, 03:19 PM
  5. Replies: 3
    Last Post: 06-17-2008, 08:57 PM

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