Paste "live date" as picture with specific name

Bret1

Board Regular
Joined
Jun 14, 2013
Messages
199
On my sheet, I have a cell with today's date "=TODAY()" ... I have another cell with a picture of the live date (as a date reference) from last time.
Whenever I run the Macro, I want it to delete the old date pic (named "Picture 20"), copy the "live date", and paste it as a new pic where the old pic was.... And name the new pic "Picture 20" same as the old pic so it'll delete it again next time I run the macro.

I can "record" a new Macro and get the basics (I'll post below), but the problem is that I need it to name the new pasted pic the same name as the deleted pic was originally - so it'll be able to delete the pic next time I run the Macro.

Can I force it to give the newly pasted pic a specific name?
Thanks

Here is what I have...
Code:
Sub Date_Move_As_Pic()
'
' Date_Move_As_Pic Macro
'


'
    ActiveSheet.Shapes.Range(Array("Picture 20")).Select
    Selection.Delete
    Range("AD17:AG18").Select
    Selection.Copy
    Range("K17:N17").Select
    ActiveSheet.Pictures.Paste.Select
    Application.CutCopyMode = False
    Range("L21").Select
End Sub
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Was able to do it this way....
Select the object in range and delete, select live date and paste as pic...

Code:
Sub MoveDate()
'
' MoveDate Macro
'


'
Dim shp As Shape
Dim r As Range


Set r = Range("K17:N18")


For Each shp In ActiveSheet.Shapes
    If Not Intersect(Range(shp.TopLeftCell, shp.BottomRightCell), r) Is Nothing Then _
        shp.Select Replace:=False
Next shp
    Selection.Delete


    Range("AD17:AG18").Select
    Selection.Copy
    Range("K17:N18").Select
    ActiveSheet.Pictures.Paste.Select
    Application.CutCopyMode = False
    Range("O5").Select
    
Application.Run "SelectShape"
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,952
Messages
6,175,594
Members
452,655
Latest member
goranzoric

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