Macro help - reseting form with drop down lists and data cells

meridith71

New Member
Joined
Jul 17, 2012
Messages
1
Hi there,
I am new to macros and do not really know much so please bear with me and forgive me if I need to be "taught" in simple terms. :confused:

I have created some forms in Excel (by cutting and pasting them from an internal company website). The drop down lists copied nicely into Excel. It was not feasible to re-type the drop down lists since some have over 100 choices.

My boss has asked me to create a macro so that the form can be "reset" or "cleared" either by clicking a button or hitting "enter". Please note that some cells will have typed data and others will have drop down lists. I would prefer a button that when clicked resets the data. All of the drop downs and data fields are in Column B. For example B4:B58 are the cells that I will need reset.
I have multiple sheets in each workbook that will need to have this macro.
Sorry if I have given too much (or not enough) info. Any help will be appreciated! Thank you.
-Meridith
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hello and welcome to the Board

First thing we need to determine is the exact nature of your drop down lists, it's not clear for me, I wonder if they are ActiveX controls like ComboBoxes. So I ask you to activate the sheet where they are and to run the macro below, and report the result here.
This macro also shows how to clear an "ordinary" range of cells.
If you need more detailed guidance please ask.

Code:
Option Explicit


Sub Meri()
Dim obj As OLEObject, act As Worksheet, mylist$


Set act = ThisWorkbook.ActiveSheet
mylist = ""


For Each obj In act.OLEObjects
    
    mylist = mylist & obj.Name & vbNewLine
            
Next


MsgBox mylist, vbInformation, act.OLEObjects.Count & " objects found"
MsgBox "Clearing b15:b20..."
act.Range("b15:b20").ClearContents


End Sub
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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