Need help creating macro shortcut button

ip

New Member
Joined
Mar 7, 2004
Messages
10
Hi all, just found the board... great stuff.

I'm trying to figure out how to run a macro by simply pressing a button in a cell. I've been able to create some simple macros based on multiple data filters but instead of going to the menu and choosing which macro (filter set) to run, I'd prefer to just click a cell to run each one.

I did find this thread ( http://www.mrexcel.com/board2/viewtopic.php?t=78340&highlight=macro+shortcut ) that explains it but (no offense to anyone), it's Chinese to me. ;)

I'm a relative newbie so please give as detailed info as possible.

Many thanks!
 

Some videos you may like

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

golf4

Active Member
Joined
Jul 8, 2002
Messages
452
Hi, ip -

Welcome......

I think if you explain the type of filtering you want to occur, we ( :rolleyes: ) can help you out. I just created some command buttons that filters a database of mine, and with thehelp of a lot of people here, it works great.

If you provide more details, I'm sure help will be forthcoming.

HTH,

Golf
 

beach

New Member
Joined
Feb 1, 2004
Messages
38
quick way I use is to create a rectangular auto shape the same size as the cell you want the macro to be in, and put the autoshape over that cell.

(Format the autoshape to a colour so it stands out)

Then just asssign a macro to the auto shape, by "right clicking" the auto shape and assigning the macro

Cheers
 

DRJ

MrExcel MVP
Joined
Feb 17, 2002
Messages
3,853
To set it up to work when you click a certain cell try putting the code in the worksheet section of vba. Right click on the sheet tab and select view code.

Then put in this code

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Select Case ActiveCell.Address

Case "$A$1"
Code Here

Case "$A$2"
Different Code here

End Select

End Sub
 

ip

New Member
Joined
Mar 7, 2004
Messages
10
beach said:
quick way I use is to create a rectangular auto shape the same size as the cell you want the macro to be in, and put the autoshape over that cell.

(Format the autoshape to a colour so it stands out)

Then just asssign a macro to the auto shape, by "right clicking" the auto shape and assigning the macro

Cheers

Thanks for the various solutions but this way was a cinch to do. Thanks, it's perfect.

(y)
 

Watch MrExcel Video

Forum statistics

Threads
1,123,143
Messages
5,599,975
Members
414,354
Latest member
Flaxarn

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
Top