Can't record macro for Conditional Formatting

wilkisa

Well-known Member
Joined
Apr 7, 2002
Messages
657
Office Version
  1. 365
  2. 2016
  3. 2013
Platform
  1. Windows
I am trying to record a macro for conditional formatting but when I check the VB Editor after I finish recording it, it only has

Sub CFTest()
'
' CFTest Macro
'

'
Range("D1:D4").Select
End Sub


Can someone help me get the keystrokes to record or tell me what I need to do?

Thanks,
Shirlene
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
I am testing conditional formatting in a macro. I am trying to record my setup to use in an existing macro. I can modify it, I think, once I get the code "on paper". I turn on the RECORD MACRO and I'm naming it CFTEST. I am using range D1:D4 with my test values.

If the cell value <=Today(), change the font color to BOLD RED with GRADIENT WHITE/PINK FROM CENTER. If the cell value is between =Today() and =Today()+14, change the font to BOLD BLACK. If the cell value is between =Today()+14 and =Today()+30, change the font to BOLD ORANGE.

I cannot get any of these conditions to record. Can you help?
 
Upvote 0
1st thing is that your parameters overlap.

I assume you have more than 3 formats to apply ?
 
Upvote 0
The fact that my parameters overlap doesn't have anything to do with the keystrokes not recording. I appreciate that fact that you are taking time to look at this but would you please address my problem? I can tweak my parameters after I get it into VB.
 
Upvote 0
Thanks, Steve. I'll see what I can do with that.
 
Upvote 0
My guess is that you're not "Completing" the setup of the conditional format.

The macro recorder doesn't record your conditions untill you click OK all the way through,and are back at the sheet and the conditional formatting is actually functioning.

If you're just going in and putting in the criteria and selecting the format, then clicking Cancel, that's why it's not being recorded.
 
Upvote 0
Thanks for the reply, Jonmo. I recorded my macro again. For each step in the condition, I hit APPLY before I hit New Rule for the next condition. I verified that I completed it and hit OK when done. I then opened the VBEditor and checked the module; it is just exactly as I pasted it in the first part of this thread.

Do I need to enable or add something? I'm just stumped!
 
Upvote 0
Sorry, I've been unable to duplicate the problem. It records for me.

Does it record ANYTHING? Like just go selecting some cells and typing random stuff.
Does it record that?

Are macros Enabled?

And please forgive the silliness of this question, but...

Are you clicking "Stop Recording" before going into the VBA window and checking the code?
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,240
Members
448,555
Latest member
RobertJones1986

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