Need Macro help!

mocephur

New Member
Joined
Jul 11, 2007
Messages
14
Excel gurus,

I need help writing a macro.

I have data in cells for column A....the data looks like this......"Review in 10 - 12/22/21"

I would like a macro that looks at the cells and compare the "Review in ?" value to the date listed....if it's 10 business days or over it turns the cell RED. If there is no data in the cells for column A it disregards.

The "Review in ?" can have any value....1 to 30.

Can anyone help me?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Does it have to be a macro? Some nice conditional formatting formulas can do the trick. This highlights in RED anything where TODAY is more than X days after the date listed. You might want to link to an array of holidays in the WORKDAYS formula.

MrExcelPlayground6.xlsx
H
2Review in 10 - 12/22/21
3Review in 5 - 12/25/21
4Review in 10 - 1/2/22
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
H2:H4Expression=TODAY()>WORKDAY.INTL(VALUE(RIGHT(H2,LEN(H2)-SEARCH("-",H2))),VALUE(LEFT(RIGHT(H2,LEN(H2)-10),SEARCH("-",RIGHT(H2,LEN(H2)-10))-1)),1)textNO
 
Upvote 0
CHanges all of the H's to A's, select A2 and conditional formatting- by formula, then paste that in there, and then customize the formatting. Then you can right-click on A2, and drag down 'formatting only'.

Or you select the whole range that starts in A2, and conditional formatting then...
If the second row isn't right, change the 2 to something else.
 
Upvote 0
ok....i see my problem.....i forgot to mention that after the date there can be more info

Review in 1 - 12/30/21 - xxxxxxxx - xxxxxxxxxxxx and so on.....the data after the date isn't fixed, it's just whatever the user enters

Can we make that work?
 
Upvote 0
It gets weirder
MrExcelPlayground6.xlsx
H
8Review in 10 - 12/22/21 - jkfasdlj - asjdflkas
9Review in 5 - 12/25/21 - dsfjlaskd
10Review in 10 - 1/2/22 - jsldkjfal
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
H8:H10Expression=TODAY()>WORKDAY.INTL(VALUE(MID(H8,SEARCH("-",H8)+2,SEARCH("-",H8,1+SEARCH("-",H8))-SEARCH("-",H8)-2)),VALUE(LEFT(RIGHT(H8,LEN(H8)-10),SEARCH("-",RIGHT(H8,LEN(H8)-10))-1)),1)textNO
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,306
Members
449,079
Latest member
juggernaut24

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