+ Reply to Thread
Results 1 to 3 of 3

If Then statement using Search or Find command

  1. #1
    Registered User
    Join Date
    02-24-2009
    Location
    Shelley, ID
    MS-Off Ver
    Excel 2007
    Posts
    10

    If Then statement using Search or Find command

    I am pulling in hourly weather data from a weather website. I am then using search and offset codes to select certain data that I want and copy and past it over to a new sheet. The problem is that every day about two hours until sunset, they data I am pulling in has a new row with the time for sunset. This throws off all of my offseting code after that row.
    I need help trying to figure out the syntax where it it will search for "sunset" and if "sunset" is found it will delete entire row (so my offsets can continue to work), if no "sunset" exists (else) continue with code.

    This is what I have so far....
    Please Login or Register  to view this content.
    The problem with this code is that the cell that contains "sunsetSunset" also has a time in the cell (like this sunsetSunset 9:01 p.m.), so my current code won't find and count the cell. The time constantly changes so it is not like I can hard code it.

    Any help would be appreciated. Thanks.

  2. #2
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Re: If Then statement using Search or Find command

    You don't actually need your 'CountIf' if you use a range, and "On Error" to avoid the error thrown if it doesn't find it.

    Please Login or Register  to view this content.
    If you find the response helpful please click the scales in the blue bar above and rate it
    If you don't like the response, don't bother with the scales, they are not for you

  3. #3
    Registered User
    Join Date
    02-24-2009
    Location
    Shelley, ID
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: If Then statement using Search or Find command

    Thanks! That was what I was looking for. I tried somehting similar to that, but I must have got it wrong.

    Thanks again.

    Trey

+ 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