Macro Slow

WindowGuy

New Member
Joined
Sep 12, 2023
Messages
18
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
Hi There. I am not good at this so please bare with me. I copied the following code from the internet to reset all my dropdownlist but it is SOOOOO slow. Like literally 4+ minutes to reset my page. I created myself a quoting program for my small business and would like to default to start fresh again on all dropdown lists. please help and see what i copied and used which is slow. Again i barely understand this so easy on my with terms of answers.

VBA Code:
Sub DropDownListToDefault()
    Dim oCell As Range
   
    For Each oCell In ActiveSheet.UsedRange.Cells
        If HasValidation(oCell) Then
            oCell.Value = "'- Choose Option -"
            End If
    Next
   
End Sub

Function HasValidation(cell As Range) As Boolean
    Dim t: t = Null
   
    On Error Resume Next
    t = cell.Validation.Type
    On Error GoTo 0
   
    HasValidation = Not IsNull(t)
End Function

Thanks in advance.

George.
 
Last edited by a moderator:
Glad we could help & thanks for the feedback.
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,215,326
Messages
6,124,268
Members
449,149
Latest member
mwdbActuary

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