VBA Macro tool needed for operator to colour cells from a reference

Joined
Jan 5, 2012
Messages
38
Hello Forum!
May i ask for VBA codes help?

The first sheet of the workbook is where everything takes place.
The source of reference is on Worksheet two (known as Detroit) and on worksheet three (known as new york)
On Worksheet one, the headers (text) are on row 1, from column A to column L.
The content (data) goes from row 2 and down. The number of rows is a variable.
Column A is “Staff ID number” and from row 2 to down, all cells are numbers
I need a macro to on the header (row 1). Look for a header that is called “Fruit_name”
Once this column is located on row 1 (it is variable and is not fixed column but can be found between column A and column L).
Once this column is located, I need the macro to start looking down from row 2 and down and end only when the last row is completed.
The source of reference can either be from sheet two or sheet three and this is selected by the operator from the start of the macro.
Can the macro be program to ask the operator a question such as “Where should the reference sheet be?” And then allow the operator to choose either sheet two or sheet 3 as the source of reference.
Once the reference sheet is chosen, on the reference sheet, there are data/information on column A only. There are no header and the information goes from row 1 and down the rows and the number of rows is not fixed.
The cells contains name of fruits, such as A1 is “Apple” and A2 is Grapes and A3 is Strawberries (examples).
The macro is then going to look up the cell in sheet 1 against the selected sheet and if the name of the fruit is found, it is going to colour the cell blue in colour. If the name of the fruit cannot be found in the sheet 2, it is not going to do anything. It then goes to the next row below/down and repeat the same process and colours the cell blue if the name of the fruit can be found on the reference sheet.

Thank you for all your help!
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top