Resetting Data Validation

Glaswegian

Well-known Member
Joined
Oct 14, 2003
Messages
1,487
My spreadsheet contains a number of cells where I've used data validation to present users with a choice of 4 options - they simply pick a letter and that is then printed when they eventually print the sheet. The cells will remain blank if not selected - this is dependent on the customer type etc. The workbook will be saved under a customer ref, so the validation cells will remain as originally chosen.

However, the next time the user opens the blank workbook(not the one saved with the customer ref) the validation cells should be blank/reset. Is it possible to do this?
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Couldn't you save your blank workbook as a Template? When the user opens it (Using File|New) Excel will create a copy so that the original is not overwritten.
 

Glaswegian

Well-known Member
Joined
Oct 14, 2003
Messages
1,487
Hi Andrew

I guess that is a possibility, although the users are a pretty diverse bunch, with many only having very basic PC skills. In some cases they'll be doing well if they can open and save the original file.
 

jdee

Active Member
Joined
Sep 10, 2003
Messages
276
I'm not sure this is the best answer available, but this is how I solved a problem similiar to yours.

I recorded a macro called "answers_reset". What is did was blank all the answers to the selected answers and replace them with the answer "Answer Reset".

In this way the person opening the sheet would see all the questions to be chosen set at "answers reset". They then can choose their answer from the data validation choices. It also helps in that I can automatically tell if they have left a particular answer blank. Hope this helps. J.Dee
 

Glaswegian

Well-known Member
Joined
Oct 14, 2003
Messages
1,487

ADVERTISEMENT

Hi jdee

Thanks for your suggestion. I tried the following on workbook close

Worksheets("DFAS").Range("B16:B34").ClearContents.

This cleared the cells OK. Unfortunately, when I re-opened the saved workbook, the cells had indeed been cleared - but I really need to have the selections 'permanent' within the saved workbook. The code is fine for when the user re-opens the blank workbook.

Is it possible to ensure that the selections remain in place in the saved version but are cleared when the blank version is opened?
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
What's the name of the blank workbook? You could clear the cells when it's opened (instead of when it's closed), eg:

Code:
Private Sub Workbook_Open()
   If ThisWorkbook.Name = "Blank.xls" Then
      Worksheets("DFAS").Range("B16:B34").ClearContents
   End If
End Sub
 

Glaswegian

Well-known Member
Joined
Oct 14, 2003
Messages
1,487
Thanks Andrew

If I'd stopped to think then that solution would have been obvious!!

Cheers. :oops:
 

Watch MrExcel Video

Forum statistics

Threads
1,127,182
Messages
5,623,229
Members
415,957
Latest member
Newguy1924

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
Top