Results 1 to 6 of 6

continuing and starting new with

Threaded View

  1. #1
    Registered User
    Join Date
    01-29-2014
    Location
    Regina, SK
    MS-Off Ver
    Excel 2013
    Posts
    20

    continuing and starting new with

    Sample of my code:

    sub findPInfo ()
    
    With Sheet1.Range("A:A")
            Set rFound = .Find(What:="Address:*", _
            After:=.Cells(1, 1), LookIn:=xlValues, _
            Lookat:=xlWhole, MatchCase:=False)
            If rFound Is Nothing Then End With
            rFound.Select
            rFound.TextToColumns DataType:=xlDelimited, _
            TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
            Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
            :=":", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
            'rFound(1, 2).Select
            rFound(1, 2).Copy Range("ZZ1")
            
            End With
            
            
            With Sheet1.Range("A:A")
            Set rFound = .Find(What:="ward:*", _
            After:=.Cells(1, 1), LookIn:=xlValues, _
            Lookat:=xlWhole, MatchCase:=False)
            If rFound Is Nothing Then End With
            rFound.Select
            rFound.TextToColumns DataType:=xlDelimited, _
            TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
            Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
            :=":", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
            'rFound(1, 2).Select
            rFound(1, 2).Copy Range("ZZ2")
            
            End With
    
            End Sub
    So the problem is that "If rFound Is Nothing Then End With" doesn't work. Am wondering can I say "Next with" or "GO TO Next With". What would be the right thing here.

    Last edited by xcel_rider; 04-09-2014 at 10:53 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Looping for filtering through data to rmove stock based on if statements
    By chrisjames25 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-04-2013, 01:11 PM
  2. Looping with IF statements and malfunction?
    By c0d3crunch3r in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-11-2012, 04:02 PM
  3. Replies: 5
    Last Post: 09-27-2012, 07:30 PM
  4. Doublecheck with second lookup starting starting after first match
    By zekethewolf in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-06-2011, 06:36 AM
  5. Looping IF statements?
    By Leumas786 in forum Excel General
    Replies: 1
    Last Post: 06-30-2011, 03:12 PM

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