+ Reply to Thread
Results 1 to 3 of 3

Filter code skipping a line

  1. #1
    Forum Contributor
    Join Date
    12-15-2008
    Location
    Oxfordshire, UK
    MS-Off Ver
    2007.
    Posts
    100

    Filter code skipping a line

    Hi All,

    Apologies for the vague title, but I currently have a problem where a routine is called from a cmb, but it misses the first line. If I go into the VBA project and run it from there the line is not skipped. I will include the code from the cmb.
    cmb code:

    Please Login or Register  to view this content.
    Update_All code

    Please Login or Register  to view this content.
    and the FH to Cal code whree the problem lies.

    Please Login or Register  to view this content.
    The problem is that the figure on row 3 that should be updated with the above formula is not, but as I said if I run it from the project it works.

    Any ideas??

    JD

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Filter code skipping a line

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

    Your code starts by checking if Sheet1 is visible & hides it if it is. It then tries to activate the hiddn sheet.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    12-15-2008
    Location
    Oxfordshire, UK
    MS-Off Ver
    2007.
    Posts
    100

    Re: Filter code skipping a line

    Roy,

    Solved the problem by re-ordering the Update_All code. For some reason the last one one, APUHrstocal was reformatting the cells with its calculation. very wierd. This is now run first and the prolem has dissappeared.

    The reason behind hiding the sheet hiding is that I could not stop excel going to sheet 1 when the code was being run and then coming back to sheet 2. I want sheet 2 to remain as the active sheet, but the code to still run on sheet 1. I guess my lack of knowledge with selecting sheets has forced me down this route. As for the users, it does not matter if they already have sheet 1 open, but as it is it closes it for them.

    JD

+ 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