+ Reply to Thread
Results 1 to 3 of 3

Custom Function Fails When Row Hidden

  1. #1
    Registered User
    Join Date
    01-17-2013
    Location
    UK
    MS-Off Ver
    Excel for Mac 2011 / Excel for Windows 2007
    Posts
    2

    Custom Function Fails When Row Hidden

    Hi,

    I have a spreadsheet that counts the value of cells in certain colours. This function works fine.

    I then added a function to hide rows based on a cell value within the each row. On it's own, this works fine.

    With both functions in the file the colour counting function still works, unless I hide rows. For the hidden rows the colour counting function fails. However, if I hide the rows manually, everything works fine.

    For added complexity I need to do this on two platforms:

    On a Windows XP system running Excel 2003 all the relevant rows are hidden, but the colour counting function does not return a value

    On a Mac running Office for Mac 2011 (Excel 2011) execution stops at the first error, with only the first row being hidden

    I have attached the spreadsheet for reference.

    FYI, I have added a forced sheet recalculation in the code, which on XP covers up the problem. However, this is not a long term fix; I need to get it working properly.

    In any case, on the Mac the forced recalculation hack doesn't work at all.

    Can anyone suggest why my colour counting function on a row should fail when that row is hidden?

    Regards

    Darren.
    Attached Files Attached Files

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Custom Function Fails When Row Hidden

    the only thing I did to make it works properly was to make recalculation MANUAL at the beginning of the HIDE macro and to reset it to AUTOMATIC at the end and also to have the sheet recalculated.
    I don't know how this will work on a Mac though.
    I think that while processing the HIDE macro, Excel is trying to calculate the sheet and is not able to do it for your special function. Making recalculation MANUAL prevent this and when you ask Excel to calculate the sheet, there is no error registered in those cell and it runs OK. Just a guess!
    Please Login or Register  to view this content.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    01-17-2013
    Location
    UK
    MS-Off Ver
    Excel for Mac 2011 / Excel for Windows 2007
    Posts
    2

    Re: Custom Function Fails When Row Hidden

    That worked great, thanks for your help.

+ 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