Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

macros in excel

Status
Not open for further replies.

brh01

Technical User
Feb 23, 2003
103
I want a small form to open when I click on a specific cell in my worksheet. can i assign a macro to a specific cell?

Brian
 
Hi brh01,

You can't directly make a macro run when you click on a cell, but there are a couple of options.

1. You could put a button on the sheet which precisely covers the cell so it looks like the User is clicking the cell.

2. You could put code in the Worksheet Selection Change Event which checked the Target address and only acted if it was the particular cell you wanted.

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
I went w/ # 1 to start, and thank you. how do I bring cell L1 into focus when the button is clicked?

Brian
 
Hi brh01,

What do you mean when you say bring cell L1 into focus ? You must code in the button's Click Event.

If you want to make L1 the active cell, use [L1].Activate

If you want to do something with the contents of cell L1, you don't need to Select or Activate the cell, for example MsgBox [L1].Value

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
To make the button exactly fit the cell, hold down ALT when moving or sizing the button and it will snap to the gridlines.

Regards
Ken.............

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]

----------------------------------------------------------------------------
 
[L1].Activate...worked like a charm...Thanks all!



Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top