Clearing cells upon making a selection from combo box

pvr928

Well-known Member
Joined
Oct 21, 2002
Messages
790
I am setting up a calculation tool and want to have the contents of certain cells return to zero via the use of a macro once zero is selected from a list in a combo box.

Any ideas on how to do this?

Cheers

pvr928
 

Some videos you may like

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

pvr928

Well-known Member
Joined
Oct 21, 2002
Messages
790
Thank you

I assigned a macro to the ComboBox via the right mouse button - it came up as DropDown23 - but it is a ComboBox.

This is what I then typed in Module 1:

Private Sub DropDown23_Change()
If DropDown23.Value = 0 Then
Range("E5").Value = 0
End If
End Sub

It is coming up as having an error in line 2 ("If DropDown23.Value = 0 Then")

Do you know what the problem is?

Cheers

pvr928
 

pvr928

Well-known Member
Joined
Oct 21, 2002
Messages
790
There is no code for the combobox in the sheet where the combobox is located - should there be?

Anyway, I put the code in the sheet, but it told me that it could not find the macro.

I then replaced it into the module, and the same error occurred in line 2.

Cheers

pvr928
 

Watch MrExcel Video

Forum statistics

Threads
1,122,521
Messages
5,596,644
Members
414,083
Latest member
Mrsash

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