+ Reply to Thread
Results 1 to 7 of 7

Macro to Hide Blank Rows

  1. #1
    Forum Contributor
    Join Date
    02-04-2008
    MS-Off Ver
    Microsoft Office 2007
    Posts
    261

    Macro to Hide Blank Rows

    Hii,

    Please find the attached sample file.

    I'm trying to hide and protect my M & N columns coz i had my formulas on that columns,i dont want
    any one to see or edit that and i need to hide my blank rows as well,i can't delete
    A11:A15 rows because i need to add more employees further.I have a macro running with the
    button but when i protect the sheet i cant run it.

    Any Suggestions..

    Thanks,
    Ak
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Macro to Hide Blank Rows

    Hi akbar, here's an example that I hope you will find useful:
    Please Login or Register  to view this content.
    You can use set protection using UserInterface to allow macros to work, or alternatively by unprotecting the sheet every time you do the routine. In the example here, I toggle between hide and unhide both the empty rows and columns M & N.

    Cheers,
    berlan

  3. #3
    Forum Contributor
    Join Date
    02-04-2008
    MS-Off Ver
    Microsoft Office 2007
    Posts
    261

    Re: Macro to Hide Blank Rows

    Thanks for your reply berlan,

    how could i assign that to my command button..

  4. #4
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Macro to Hide Blank Rows

    No problem, glad to help! Thanks for the positive rep

    Implemented the code into your commandbuttons and put the protection code in an open_workbook routine in the ThisWorkbook module. See attached.

    Best,
    Johan
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    02-04-2008
    MS-Off Ver
    Microsoft Office 2007
    Posts
    261

    Re: Macro to Hide Blank Rows

    Thanks Berlan for your response,

    But its hiding M:N columns too,i dont want that to happen only the rows to be hidden..

  6. #6
    Forum Contributor
    Join Date
    02-04-2008
    MS-Off Ver
    Microsoft Office 2007
    Posts
    261

    Re: Macro to Hide Blank Rows

    I have changed myself,Thanks a lot Johan..

  7. #7
    Forum Contributor
    Join Date
    02-04-2008
    MS-Off Ver
    Microsoft Office 2007
    Posts
    261

    Re: Macro to Hide Blank Rows

    Hi Johan,

    When i copied it to my original template it gave me ,run time error - 1004,unable to set the hidden property of the range class..

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Hide blank rows button macro
    By cabinetguy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-30-2016, 07:21 AM
  2. [SOLVED] Macro to hide blank rows
    By Naz555 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-07-2014, 03:19 AM
  3. Hide Blank rows via VBA / MAcro
    By English_Bloke82 in forum Excel General
    Replies: 4
    Last Post: 11-03-2011, 05:59 AM
  4. Macro To Hide Blank Rows
    By markrennolds in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-22-2010, 07:14 PM
  5. macro to hide rows if cell is blank
    By Shooter in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-28-2005, 06: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