Enter Starting Date MMM YYYY To Continue Running MACRO

CWOVette

New Member
Joined
Oct 31, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Good day.

I am running the provided MACRO to auto populate Months in consecutive cells. It starts with Cell A2 (starting range) in which there is a date Oct 2023. This will be added to a larger MACRO and I want to learn how to add a message box telling the user to enter a date in the MMM YYYY format which will fill Cell A2 and then continue the execution of the MACRO. I want to be able to change the start date every time this part of the MACRO runs.

Sub ztest()
'
' ztest Macro
'
'Activate worksheet
Worksheets("Sheet1").Activate

'Select source range
Set startingRange = ActiveSheet.Range("A2")

'Autofill destination range with xlFillMonths
startingRange.AutoFill Destination:=Range("A2:X2"), Type:=xlFillMonths


End Sub

Thanks to all for the lesson.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
I think you should research the input box function. Since there are many aspects to it, it's best that you research it to learn various ways it can be used.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,154
Members
453,021
Latest member
Justyna P

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