Results 1 to 3 of 3

Thread: <RESOLVED>find out which cell i have clicked on

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    South Africa
    Posts
    113

    Question <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!

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Aug 2000
    Location
    South Africa
    Posts
    113

    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!

  3. #3
    Frenzied Member Spajeoly's Avatar
    Join Date
    Mar 2003
    Location
    Utah
    Posts
    1,068
    Yes, do like this...

    VB Code:
    1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    2.     msgbox ActiveCell.Address, VBInformation, "Weeeeee!!!"
    3. 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:
    1. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    2.     If ActiveCell.Address = "$B$1" Then Call CoolNiftyAndHandyProcedure
    3. 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
  •  



Click Here to Expand Forum to Full Width