Cell Range Font color change add to existing code

nhbartos

Board Regular
Joined
May 23, 2015
Messages
148
Hi folks...

I have one for you. Still a newby here and learning how to edit existing macros.

I decided that at the end of this macro, after Range ("f13:eek:13").Select, I would like this specific cell range font to change from white to green. I am missing something and can't get it to work.

Here is the last bit of code:

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowInsertingColumns:=True, _
AllowInsertingRows:=True, AllowInsertingHyperlinks:=True, _
AllowDeletingColumns:=True, AllowDeletingRows:=True, AllowSorting:=True, _
AllowFiltering:=True, AllowUsingPivotTables:=True
Sheets("0 Student List").Select
Range("F9").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Range("F13:O13").Select
End Sub

Thanks in advance!
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
try:
Code:
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, userinterfaceonly:=True
Range("F13:O13").Font.Color = vbGreen
 
Upvote 0
Hi thanks JoeMo! Works fine.
Is there a way for it to time out and revert back to the original color?
Currently the text is invisible as I matched it to the background.
I only want the text to appear at a certain point in time, then go back to the original color.
Possible?
 
Upvote 0
Once the text appears, you can use
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;">Application.Wait(Now + TimeValue("0:00:01"))
</code>(Time is in H:MM:SS)

After that line, you can use
Range("F13:O13").Font.Color = "your original color"
 
Upvote 0
Hi thanks JoeMo! Works fine.
Is there a way for it to time out and revert back to the original color?
Currently the text is invisible as I matched it to the background.
I only want the text to appear at a certain point in time, then go back to the original color.
Possible?

For how long would you like it to be green before reverting to white, and will you need to use Excel while the clock is running?
 
Upvote 0

Forum statistics

Threads
1,216,587
Messages
6,131,586
Members
449,657
Latest member
Timber5

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