Link to home
Start Free TrialLog in
Avatar of Luis Diaz
Luis DiazFlag for Colombia

asked on

VBA excel: highlight values based on string reported in a range

Hello experts,

I am looking for a procedure in order to highlight cells based on the following requirement :
User generated image1-Show up an input box (“Please report the column in which you want to highlight the values. In my example it should be column A).
2-Show up a second input box ("Please report the string that you want to filter. In my example it should be “completed” the filter should apply a contains and not an equal")
3-Show up a third input box ("Please report  the Range columns in which is located the string related to the filter. In my example it is B:E"). The macro should be able to loop from the first used range to the last used range of the reported range.
4-The cells reported in column A which have a value which contains the string “completed” in the reported range of point 3 should be highlighted in green as shown in my example.


Please find attached my dummy file.

If you have questions, please contact me.

Regards,
Avatar of Bill Prew
Bill Prew

No file attached...
Avatar of Luis Diaz

ASKER

Sorry for that. Please find attached dummy file.
Highlight_values_based_on_string_re.xlsx
Okay, this should get you started.  I didn't get fancy, so there is no editing of input to make sure it's valid, etc.  You can certainly add that.  Attaching the spreadsheet with the form and macro in it.  Here is a sample picture of how I filled out the form for testing.

User generated imageEE28996608.xlsm
Thank you very much for this proposal.
I will test it this weekend!
Test it and it works. Very useful the form!
I have a little remark:
When I click on "Ok" and I haven't fill all the required data I have an error code. In order to avoid this is not possible to add a complementary routine in order to exit sub when all the required data is not properly filled?
I have also a question: How do you do to hide the routines within the modules? (very useful).
I wasn't unable to see the code. The unique way was to  generate to generate an error after displaying the form.
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Tested and it works! Thank you very much for your help!