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
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