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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
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,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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