+ Reply to Thread
Results 1 to 3 of 3

Assign and found range to a variable

  1. #1
    Forum Contributor
    Join Date
    09-03-2008
    Location
    Somerset, England
    MS-Off Ver
    XP, 2003, 2007 - depends on location
    Posts
    185

    Assign and found range to a variable

    Hi all,

    I am using a standard find routine to find the first match for a set of search critera. I then wish to display this crieria in a user form, but I am unsure of how to extract the range of the find result in to suitable variables to do this.

    This is the code I am using.

    Please Login or Register  to view this content.
    So for example, if I was to search 'Gould' and the rusult was found in "C493", I would like to assign the values in "A493:R493" ('txtDateOpened.text = range("A493").value'), but obviously the result will not always be "C493". Hope that makes sense!

    Any help is greatly appricated.
    Thanks.

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,997

    Re: Assign and found range to a variable

    You can use rngFound.Row to get the row of the found item, then use that with the Range property:
    Please Login or Register  to view this content.
    for example.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Contributor
    Join Date
    09-03-2008
    Location
    Somerset, England
    MS-Off Ver
    XP, 2003, 2007 - depends on location
    Posts
    185

    Re: Assign and found range to a variable

    Sorted, thanks!

+ 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