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!
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
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
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
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)
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,427
Members
448,961
Latest member
nzskater

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