Color a shape a different color if macro is run after a timestamp and list time run

mrpaw

Board Regular
Joined
Jan 31, 2011
Messages
80
Hi All,

I'm looking for a method that will 1) visually show, by changing the shape's color, whether a macro called from a button has run and 2) post what time the macro was run. Is this even possible?
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Perhaps this will help

Code:
Private Sub CommandButton1_Click()

[COLOR=#ff0000]button macro code goes here[/COLOR]

[COLOR=#000080][I]'change shape colour[/I][/COLOR]
   ActiveSheet.Shapes("Rectangle 1").Fill.ForeColor.RGB = RGB(255, 0, 0)

[I][COLOR=#000080]'place timestamp inside shape[/COLOR][/I]
  ActiveSheet.Shapes("Rectangle 1").TextFrame.Characters.Text = "Last Run " & Date & " " & Time

[COLOR=#000080][I]'place timestamp into cells[/I][/COLOR]
  Range("A1") = Now
  Range("A2") = Date
  Range("A3") = Time
End Sub

Try recording a macro and changing the shape's colour
Look at the recorded code to get RGB values
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,749
Messages
6,180,725
Members
452,995
Latest member
isldboy

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