+ Reply to Thread
Results 1 to 2 of 2

help with code for searching for cell value

  1. #1
    Forum Contributor
    Join Date
    08-14-2013
    Location
    LA Baby!!
    MS-Off Ver
    Excel 2007
    Posts
    1,598

    help with code for searching for cell value

    Need help with the following code. What is the set range doing? Specifically, why is there a comma? What is 256 and the "find" doing? Pretty much if you could explain each piece of the code that would help. Thanks.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,364

    Re: help with code for searching for cell value

    Please Login or Register  to view this content.

    You can see it better the way I have laid it out. rng is being defined as starting at one cell and finishing with another. The first cell is: ActiveCell.Offset(0, 1); the second cell is: ActiveCell.Offset(0, 256 - ActiveCell.Column).

    So the code is looking for whatever is in the ActiveCell anywhere in the next 255 cells on the same row. If it finds it, you get one message; if it doesn't, you get a different message.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Speeding up a searching vba code
    By Sleepyshy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-11-2016, 02:38 PM
  2. Code ignores input box in Searching Cell Comments to make summary.
    By sureng19 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-14-2010, 06:19 PM
  3. Adjust code for searching up to clear cell
    By pktrusty in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-03-2010, 03:21 AM
  4. vlookup help:searching for a code
    By dangey in forum Excel General
    Replies: 4
    Last Post: 03-23-2010, 09:16 AM
  5. searching on more than one column in VB code
    By jjfjr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2005, 10:05 AM

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