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

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
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,223,705
Messages
6,173,985
Members
452,540
Latest member
haasro02

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