|
-
Apr 7th, 2003, 04:57 AM
#1
Thread Starter
Lively Member
<RESOLVED>find out which cell i have clicked on
Hi, im doing an app in excel VBA. I need to be know what cell the user has clicked on...cant remember how do do this...help please
thanks in advance
Last edited by SmagO; Apr 7th, 2003 at 05:35 AM.
You are living a pacifist dream, and if you dreaming it means you sleeping and you should damn well wake up!
-
Apr 7th, 2003, 05:31 AM
#2
Thread Starter
Lively Member
solution
There is an event that gets called when the selection changes. It passes a range object that contains the selected cell(s)
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
End Sub
it works
You are living a pacifist dream, and if you dreaming it means you sleeping and you should damn well wake up!
-
Apr 7th, 2003, 10:11 AM
#3
Frenzied Member
Yes, do like this...
VB Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
msgbox ActiveCell.Address, VBInformation, "Weeeeee!!!"
End Sub
And here is how I find out if a cell is one I want to use to call a procedure when clicked on, well ok, I admit it, i make buttons out of cells...<sob>
VB Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Address = "$B$1" Then Call CoolNiftyAndHandyProcedure
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|