Results 1 to 2 of 2

Thread: get active cell name in Excel

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2001
    Location
    Vienna
    Posts
    53

    Question get active cell name in Excel

    there's a part in my code that scans for
    the strings in the cells of my worksheet.

    this would look like this:

    VB Code:
    1. Do
    2.  
    3. '.... blah blah
    4.  
    5. Text1.Text = .Cells(i, j)
    6.  
    7. '.... blah blah
    8.  
    9. Loop

    what I want to know:

    how can I get the cell count or name or
    whatever that is:

    e.g. "A13" or "B16"

    any ideas?

    thx!

  2. #2
    Frenzied Member trisuglow's Avatar
    Join Date
    Jan 2002
    Location
    Horsham, Sussex, UK
    Posts
    1,536
    VB Code:
    1. Private Sub CommandButton1_Click()
    2.  
    3.     With ActiveCell
    4.         MsgBox "Cell " & Chr$(Asc("A") - 1 + .Column) & .Row & " has a value of " & .Value
    5.     End With
    6.    
    7.     With Cells(1, 1)
    8.         MsgBox "Cell " & Chr$(Asc("A") - 1 + .Column) & .Row & " has a value of " & .Value
    9.     End With
    10.    
    11. End Sub
    This world is not my home. I'm just passing through.

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