Having a sheet revert to blank when a new drop down selection is made

excel33

New Member
Joined
Feb 19, 2023
Messages
3
Office Version
  1. 2003 or older
Platform
  1. Windows
Hi, I am creating a spreadsheet (newbie) and i have two drop down selections. One for months and one for days (numbers from 1 to 31).
I would like the sheet to go back to blank (all except the days column) when a new month is chosen from the drop down. can anyone assist?
Thanks
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
This gives you your drop down and your days of the month (according to the month).
To clear all but A1 and B1, if you want to do it automatically you will need to create a macro.
Here is some vba you can paste into a macro code (then you will select to run it from the macro list). or you can assign it to the workbook sheetchange event
As a macro...
VBA Code:
Sub ClearAllButA1B1()
'
' ClearAllButA1B1 Macro
'

'
    Range("A2", "XFD1048576").Select
    Selection.Clear
    Range("C1", "C1048576").Select
    Selection.Clear
    Range("A1").Select
End Sub


as a worksheet change (whenever you change cell A1 - warning - will delete all every time)
VBA Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Set Target = Range("A1")

    Range("A2", "XFD1048576").Select
    Selection.Clear
    Range("C1", "C1048576").Select
    Selection.Clear
    Range("A1").Select

End Sub

mr excel questions 6.xlsm
AB
1May1
22
33
44
55
66
77
88
99
1010
1111
1212
1313
1414
1515
1616
1717
1818
1919
2020
2121
2222
2323
2424
2525
2626
2727
2828
2929
3030
3131
32
Sheet2
Cell Formulas
RangeFormula
B1:B31B1= SEQUENCE( DAY(EOMONTH(DATE(2023,MATCH(A1,{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"},0),1),0)),1,1,1)
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
A1ListJan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec
 
Upvote 0
@excel33 , If you don't have a excel 365 or 2021 the above won't do your date sequence.
Please advise.
 
Upvote 0
Excel 2016. The idea is that when a month is selected from the drop down at B3 the spreadsheet should revert to blank for all coumns that would have had figures inputted in the rows below the headings. It's basically to track expenses without having to copy and paste this sheet 12 times. I hope I am explaining things properly.
1676825242126.png
 
Upvote 0
Okay, does 2016 have the sequence function?
and are you doing this on twelve worksheets? Why have a month drop down? or are you going to copy the workbook after each sheet is set up?
 
Upvote 0
Okay, does 2016 have the sequence function?
and are you doing this on twelve worksheets? Why have a month drop down? or are you going to copy the workbook after each sheet is set up?
No it doesnt. No one worksheet. But i am rethinking now based on what i need it for as i figure the information would be lost when the sheet reverts. Is that so?
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,893
Members
449,097
Latest member
dbomb1414

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