+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    Registered User
    Join Date
    03-10-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Find and Replace with multiple conditions problem.

    I downloaded your newest sheet, and I get the same error when I try to run it. I just open the file, and click "Generate Schedule" and then leave all the values normal (all employees "Available") and hit the generate button on the userform. I immediatly get an Error: Runtime Error '6': Overflow. When I click debug, it highlights the find section of code in the Find_QA function

    Code:
    Set strFind = .Find(What:=FindString, _
                        After:=.Cells(.Cells.Count), _
                        LookIn:=xlValues, LookAt:=xlWhole, _
                        SearchOrder:=xlByRows, SearchDirection:=xlNext, _
                        MatchCase:=False)
    when I hover over the strFind variable, it says strFind = Nothing, which seems normal, and FindString = QA, which also seems normal, I'm not sure why its hanging up, should there be a range attached to the With Sheets("Data").Cells ?

  2. #17
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    18,228

    Re: Find and Replace with multiple conditions problem.

    When I open the sheet, click your button and then generate, I get an instant finish with:

    Code:
    QA	Maryetta
    MH	Charmaine
    PR	Connie-Lee
    PR	Shannon

    Here's a different syntax for one line, replace all the macros on this line to:

    Code:
                    After:=.Cells(.Rows.Count, .Columns.Count), _
    See if you get better results. It's working as is for me.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  3. #18
    Registered User
    Join Date
    03-10-2010
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Find and Replace with multiple conditions problem.

    That works perfectly! I'm not sure what the difference in syntax was, but that last change made it work exactly they way I wanted, finally. Thanks so much for your help

    Chris

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.2.0