Results 1 to 2 of 2

Thread: Excel

  1. #1
    Join Date
    Sep 2005
    Posts
    313

    Unanswered: Excel

    If (Worksheets("Sheet1").Range("D2").Select = True) Then
    MsgBox "You reach D2"

    End If


    It 's doesn't work correctly. Because when I run this, it is checking, the program select the cell D2, then give out message. It is incorrect.

    How can I make a checking function?

  2. #2
    Join Date
    Jun 2002
    Location
    Houston, TX
    Posts
    116
    Try this:
    Sub checkA()
    If (ActiveCell.Address(False, False) = "D2") Then
    MsgBox "You reach D2"
    Else
    MsgBox "You are at " & ActiveCell.Address & ""
    End If

    End Sub
    texasalynn
    It's AWL Good!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •