+ Reply to Thread
Results 1 to 7 of 7

FindNext

  1. #1
    Registered User
    Join Date
    08-26-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    32

    FindNext

    I am having trouble to get the 3rd FindNext to work in my document.
    I am trying to find the expense amount for 1 job but 3 entries for that 1 "Job Name" in the data sheet and pasting it into a separate report.
    It works fine if it only needs to find 2 entries for the "Job Name"but when it goes to find the 3rd "Job Name" it finds the 2nd one again and repeats the data for the 2nd "Job Name" rather than the 3rd "Job Name".

    Please if anyone can give me any help as I would like to allow for 4 entries per "Job Name" as that would be the most entries per "Job Name"per month.

    A dummy of the 2 spreadsheets that I am using are attached.

    I have assigned crtl+shift+P for the code to run from "Pay & Reserves report-Marrero2" spreadsheet.

    Thanks
    Attached Files Attached Files
    Last edited by ddbusiness; 09-28-2010 at 03:54 AM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: FindNext

    Hi

    Here's a cut down find loop that I think does what you are trying to achieve. It doesn't rely on a fixed number - it just keeps looping until it comes back to the first point. As you have a formula in H17 of the output sheet, I've used that as a basis for fixing the output starting in column I, and then moving across as items are found. I've not brought in some of the other actions in the loop - I'll leave that for you to complete.

    Please Login or Register  to view this content.
    HTH

    rylo

  3. #3
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: FindNext

    You did not indicate what you want to do when you find the job name. I have tentatively taken that you want the cell address of the job. This macro will find ALL the locations in which injob name occurs. In the input box you have to enter the correct name with absolutely no change spelling or otherwise. to enable this I suggest first open the sheet1 and select the first occurence of the required job name. click control+C (so that it will be parked in the clipboard) and when you run the macro .in the inputbox window just click control+V. The name will be correctly copied. If you wrongly enter the job name the macro will give error. (that is it cannot find the job namae)

    THIS MACRO IS TO BE PARKED IN THE FILE genjrld1 .xls (excel version 2002 or 2003). I do not understand why you sent the other file which is excel 2007.

    the macro is

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-26-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: FindNext

    Hi

    There seems to be something wrong.
    The Loop goes for over 10 seconds and then an error message pops up of "Run time error 1004". It stops in the code with the following highlighted.
    OutSh.Cells(Columns.Count, "I").End(xlToLeft).Offset(0, 1).Value = findit.Offset(0, -1).Value

    Would you please explain more of what it is doing so I can get my head around it?
    I only have your code running and have not revised it yet to make sure I understand all of what it is doing.

    Thanks for any further assistance.

  5. #5
    Registered User
    Join Date
    08-26-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: FindNext

    The other file is the report that is being produced from the data in the genjrld1.xls file. The genjrld1.xls file is produced by my accounting package (MYOB). The code needs to be in the other file as that file will have other info in it from the previous month. I have to produce many other files from MYOB to fill in the report "Pay & Reserves report-Marrero2".

    I hope that explains it a bit more.

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: FindNext

    Hi

    Grrr. Should have tested it not just written it.

    Please Login or Register  to view this content.
    You may have to change a couple of the names, but see if that is any better.

    rylo

  7. #7
    Registered User
    Join Date
    08-26-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: FindNext

    This worked great.
    Thanks heaps.

+ 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