+ Reply to Thread
Results 1 to 3 of 3

edit macro to mathc entire cell contents

  1. #1
    Registered User
    Join Date
    09-03-2005
    Posts
    2

    edit macro to mathc entire cell contents

    I'm using the following macro:

    Sub rename()
    Dim c As Range
    Set c = Range("B:B").Find(ActiveCell)
    If c Is Nothing Then Exit Sub
    ActiveCell = c.Offset(, -1)
    End Sub

    I need to edit it so that the find is for "match entire cell contents"

    Thanks for the help!

    -Tamara

  2. #2
    Jim Rech
    Guest

    Re: edit macro to mathc entire cell contents

    Check out the Find method in VB help. In particular look at the "LookAt"
    parameter.

    --
    Jim
    "nis75p06" <[email protected]> wrote in
    message news:[email protected]...
    >
    > I'm using the following macro:
    >
    > Sub rename()
    > Dim c As Range
    > Set c = Range("B:B").Find(ActiveCell)
    > If c Is Nothing Then Exit Sub
    > ActiveCell = c.Offset(, -1)
    > End Sub
    >
    > I need to edit it so that the find is for "match entire cell contents"
    >
    > Thanks for the help!
    >
    > -Tamara
    >
    >
    > --
    > nis75p06
    > ------------------------------------------------------------------------
    > nis75p06's Profile:
    > http://www.excelforum.com/member.php...o&userid=26949
    > View this thread: http://www.excelforum.com/showthread...hreadid=401697
    >




  3. #3
    David Lloyd
    Guest

    Re: edit macro to mathc entire cell contents

    Tamara:

    The fourth parameter of the Find method indicates whether to look at all or
    part of the cell contents. For example:

    Set c = Range("B:B").Find(ActiveCell,,,xlWhole)


    --
    David Lloyd
    MCSD .NET
    http://LemingtonConsulting.com

    This response is supplied "as is" without any representations or warranties.


    "nis75p06" <[email protected]> wrote in
    message news:[email protected]...

    I'm using the following macro:

    Sub rename()
    Dim c As Range
    Set c = Range("B:B").Find(ActiveCell)
    If c Is Nothing Then Exit Sub
    ActiveCell = c.Offset(, -1)
    End Sub

    I need to edit it so that the find is for "match entire cell contents"

    Thanks for the help!

    -Tamara


    --
    nis75p06
    ------------------------------------------------------------------------
    nis75p06's Profile:
    http://www.excelforum.com/member.php...o&userid=26949
    View this thread: http://www.excelforum.com/showthread...hreadid=401697



+ 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