Resolve 'Ambiguous name detected:' Issue in VBA

wcm69

Board Regular
Joined
Dec 25, 2016
Messages
112
Hope someone can assist with a small problem I've encountered in VBA.

I've borrowed a simple code from Youtube which uses an Insert (Shape) button to clear the contents of a cell.

The issue I have is there are two different insert (command) buttons (Not Form ActiveXcontrols) on my spreadsheet but only the one code on two different modules to run both buttons. I'm trying to use the insert buttons to clear the cells for two independent/separate sets of data in two different areas of my worksheet.

The code I'm using is:

Sub clear_cells()

Worksheets ("Sheet1") .Range ("J5") .ClearContents

End Sub

When I try to run the code it comes back as 'Ambiguous name detected: clear cell'

Unfortunately as I'm not proficient in VBA coding, but I believe the cause may be that I haven't given each button / sub procedure it's own defined name, but as I don't know coding I'm unable to do this.

I'd appreciate any help.

Thanks in advance :)
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
usually means you have the same sub name twice make one clear_cells1, and then make sure you run the correct one
 
Upvote 0

Forum statistics

Threads
1,223,932
Messages
6,175,468
Members
452,646
Latest member
tudou

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