Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Nov 2001
    Location
    Calgary, Alberta, Canada
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Top Left Cell of Selection (2003)

    I have written the following code to identify the top left cell of a selection:

    Let WSar = Selection.Address
    If Range(WSar).Cells.Count = 1 Then
    Let WSarTL = WSar
    Else
    Let WSarTL = Left(WSar, Application.WorksheetFunction.Find(":", WSar) - 1)
    End If

    Does anyone know of an easier way to get this information?

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Top Left Cell of Selection (2003)

    Does:
    Selection.cells(1).address

    Give you what you want?

    Steve

  3. #3
    Lounger
    Join Date
    Nov 2001
    Location
    Calgary, Alberta, Canada
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Top Left Cell of Selection (2003)

    That works fine. I knew there was more than likely an easier way but neither a search through the help files or the Lounge came up trumps.

    Thanks.

Posting Permissions

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