Can I add this to a Macro

B

Bob Vance

--
I have a macro that copies cells and pastes them somewhere else, can I add
to the macro "if past this date 6/6/2004 to delete all macros in this book
without confirmation"


Thanks in advance.........Bob Vance
 
R

Ron de Bruin

Hi Bob

Try the examples on Chip's site
http://www.cpearson.com/excel/vbe.htm

You can use this if all your code is in one module for example

Sub Test()
If Date > DateSerial(2004, 6, 29) Then
With ThisWorkbook.VBProject.VBComponents
.Remove .Item("Module1")
End With
Else
MsgBox "place your code here"
End If
End Sub
 
R

Ron de Bruin

Hi Bob

Click on the link Bob that I posted.
Chip have a macro that remove them all
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top