+ Reply to Thread
Results 1 to 5 of 5

finding the address of a specific cell?

  1. #1
    Registered User
    Join Date
    07-25-2006
    Posts
    9

    finding the address of a specific cell?

    Dim temp_range As Range

    Set temp_range = Worksheets("Template").Cells.Find(Value:="Sum. Table", _
    SearchOrder:=xlByRows)

    When i run this in a subroutine I get this error:
    "Named arguement not found."

    All I want to do is locate the cell with the value="Sum. Table" and figure out its address so I can assign it as the beginning of a continuous range that is 3 cells wide and 4 cells deep.

  2. #2
    Gary''s Student
    Guest

    RE: finding the address of a specific cell?

    How about:

    Worksheets("Template").Cells.Find(What:="Sum. Table", After:=ActiveCell,
    LookIn:=xlFormulas, LookAt:= _
    xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
    MatchCase:=False _
    , SearchFormat:=False).Activate

    Set temp_range = Selection
    --
    Gary's Student


    "botha822" wrote:

    >
    > Dim temp_range As Range
    >
    > Set temp_range = Worksheets("Template").Cells.Find(Value:="Sum. Table",
    > _
    > SearchOrder:=xlByRows)
    >
    > When i run this in a subroutine I get this error:
    > "Named arguement not found."
    >
    > All I want to do is locate the cell with the value="Sum. Table" and
    > figure out its address so I can assign it as the beginning of a
    > continuous range that is 3 cells wide and 4 cells deep.
    >
    >
    > --
    > botha822
    > ------------------------------------------------------------------------
    > botha822's Profile: http://www.excelforum.com/member.php...o&userid=36752
    > View this thread: http://www.excelforum.com/showthread...hreadid=570094
    >
    >


  3. #3
    Otto Moehrbach
    Guest

    Re: finding the address of a specific cell?

    This code finds the cell and sets the range TheRng as you want. HTH
    Otto
    Set temp_range = Worksheets("Template").Cells.Find(What:="Sum. Table",
    LookAt:=xlWhole)
    Set TheRng = temp_range.Resize(4,3)

    "botha822" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Dim temp_range As Range
    >
    > Set temp_range = Worksheets("Template").Cells.Find(Value:="Sum. Table",
    > _
    > SearchOrder:=xlByRows)
    >
    > When i run this in a subroutine I get this error:
    > "Named arguement not found."
    >
    > All I want to do is locate the cell with the value="Sum. Table" and
    > figure out its address so I can assign it as the beginning of a
    > continuous range that is 3 cells wide and 4 cells deep.
    >
    >
    > --
    > botha822
    > ------------------------------------------------------------------------
    > botha822's Profile:
    > http://www.excelforum.com/member.php...o&userid=36752
    > View this thread: http://www.excelforum.com/showthread...hreadid=570094
    >




  4. #4
    Registered User
    Join Date
    07-25-2006
    Posts
    9
    hey guys thanks,

    what is the difference between xlPart and xlWhole?

  5. #5
    Otto Moehrbach
    Guest

    Re: finding the address of a specific cell?

    For instance, the text "Hello there" contains "Hello". If you use xlPart
    then you will find that "Hello" because you are looking at "parts" of the
    string. If you use xlWhole, then you will not find that "Hello" because
    that "Hello" is not everything that is in the cell. HTH Otto
    "botha822" <[email protected]> wrote in
    message news:[email protected]...
    >
    > hey guys thanks,
    >
    > what is the difference between xlPart and xlWhole?
    >
    >
    > --
    > botha822
    > ------------------------------------------------------------------------
    > botha822's Profile:
    > http://www.excelforum.com/member.php...o&userid=36752
    > View this thread: http://www.excelforum.com/showthread...hreadid=570094
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1