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
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,954
Members
448,535
Latest member
alrossman

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