Results 1 to 6 of 6

show/hide macro not updating

Threaded View

dwilks show/hide macro not updating 12-13-2017, 07:38 AM
bakerman2 Re: show/hide macro not... 12-13-2017, 07:44 AM
dwilks Re: show/hide macro not... 12-13-2017, 07:53 AM
bakerman2 Re: show/hide macro not... 12-13-2017, 09:55 AM
dwilks Re: show/hide macro not... 12-14-2017, 06:01 AM
bakerman2 Re: show/hide macro not... 12-14-2017, 08:06 AM
  1. #1
    Registered User
    Join Date
    12-13-2017
    Location
    Nottingham, UK
    MS-Off Ver
    MS Office Professional Plus 2013
    Posts
    4

    show/hide macro not updating

    Hi all,

    Very new to VB and macros and would appreciate some help on the below query please.

    I have the following macros running on a worksheet in order to ‘hide’ and ‘show’ rows when they contain data (or not) within the cells in the range:

    Sub HideRows_Proposal_Tables()
    Sheet4.Unprotect Password:="xxx"
    Application.ScreenUpdating = False
    Application.Calculation = xlManual
    
    For Each c In Range("D3:D22,D26:D39,E43:E57")
    If c.Value = 0 And c.Value <> "" Then Rows(c.Row).Hidden = True
    Next
    
    Application.Calculation = xlManual
    Application.ScreenUpdating = False
    Sheet4.Protect Password:="xxx"
    End Sub
    Sub ShowRows_Proposal_Tables()
    Sheet4.Unprotect Password:="xxx"
    Application.ScreenUpdating = False
    Application.Calculation = xlManual
    
    For Each c In Range("D3:D22,D26:D39,E43:E57")
    If c.Value = 0 And c.Value <> "" Then Rows(c.Row).Hidden = False
    Next
    
    Application.Calculation = xlManual
    Application.ScreenUpdating = False
    Sheet4.Protect Password:="xxx"
    End Sub

    The cells to be hidden (or shown) are populated on another worksheet in the same workbook and I've used a simple “=cellref” to populate them in the summary worksheet (the one with the macro).

    My issue comes when a user has clicked the ‘hide rows’ button on the summary worksheet, and then adds a new name in an empty cell on the input worksheet that lies within the specified range. If the ‘hide/show’ buttons are subsequently clicked, those newly populated rows remain permanently hidden (unless I un-protect the worksheet and manually un-hide them). Is there a way to resolve this, other than entering all of the information prior to pressing ‘hide’, as this is a dynamic worksheet and can be edited at any time after someone has clicked the hide/show buttons?

    I'll be honest, the above is not my handy work, I cobbled it together from sites and forums with similar issues to myself and no doubt there in lies my problem.

    Thanks,
    Last edited by dwilks; 12-13-2017 at 07:51 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Show/Hide Macro
    By leviathan86 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-08-2015, 11:38 AM
  2. [SOLVED] use macro to hide or show image
    By cyee in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2014, 03:02 AM
  3. [SOLVED] Macro to Show and Hide Comments
    By dompoma in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-17-2013, 12:27 AM
  4. conflict between auto save&close macro and show/hide sheets macro
    By alexandruc in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-18-2009, 11:56 AM
  5. how can hide and show columns using macro?
    By Hoshyar in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07:05 PM
  6. [SOLVED] how can hide and show columns using macro?
    By Hoshyar in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 PM
  7. [SOLVED] how can hide and show columns using macro?
    By Hoshyar in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 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