VBA command button for running a macro-module

epicdonk

New Member
Joined
Jul 28, 2014
Messages
2
Hi all,

I am new to this site although it is since a while that the latter has been helping me to solve excel problems.
I am starting to creating VBA code in order to make my life easier.

The problem is the following:

I created a Button (form control) on a certain sheet and then I assigned a macro to it but it does not work.

That is the code within my module:

Private Sub Delete_Click()

Application.Workbooks.Worksheets("1. Conversion").Activate

Range("FULL_YEAR").ClearContents

Range("YEAR_TO_DATE").ClearContents

Range("G3").ClearContents

Application.Workbooks.Worksheets("1. Converison").Activate

Range("A1").Activate

End Sub


But the problem is that when I try to click on the button, nothing happens...however, when I choose to manually run my macro, it says:

-- removed inline image ---


Thank you in advance for your response!

P.S: Sry for my english

BR,
Epicdonk
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Hey all,

Sry I tried to insert a printscreen from the problem. I have got a message error saying: Ambiguous name detected: Delete_click.

Thanks!

Epicdonk
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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