Macro

one_more_cave_dweller

Board Regular
Joined
Sep 27, 2004
Messages
118
Is it possible to have a macro create a sheet triggered by the date in a cell.
If so could it be triggered by the last day of the month instead of by a specific date.

Thanks :pray:
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
I'm sure it's possible.
What is it exactly you want to do, and how is the date getting entered in the cell?
 
Upvote 0
The date that would trigger the macro is entered manually. From there I can write the macro to create the form, I just need to know how to get the date to trigger it.

Thanks
 
Upvote 0
Maybe this...?

I'm using A10 as the cell to enter the date in and temporarily using A1 throughout the procedure. Change these to whatever you like.

In the worksheet module I have this:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Long, x As Long
If Target.Address <> "$A$10" Then Exit Sub
[A1].Formula = "=EOMONTH(A10,0)" '(Any unused cell you like)
x = Target.Value
i = [A1].Value

If x = i Then
    Call Macro1
    [A1].ClearContents
Else: [A1].ClearContents
End If

End Sub
Hope it helps,
Dan
 
Upvote 0

Forum statistics

Threads
1,215,772
Messages
6,126,807
Members
449,339
Latest member
Cap N

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