+ Reply to Thread
Results 1 to 4 of 4

vba code to clears cells and hide rows

  1. #1
    Forum Contributor
    Join Date
    07-01-2010
    Location
    Niles, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    137

    vba code to clears cells and hide rows

    I'm looking for some help on how to clear cells and hide rows when I hit a command button. These cells do not have any formulas in them. I need to clear the following cells
    C123:H123
    C125:H125
    B109
    F109
    G109
    B94
    F94
    G94
    B79
    F79
    G79
    B64
    F64
    G64
    B49
    F49
    G49
    B34
    F34
    G34
    B19
    F19
    G19
    B4
    F4
    G4
    Then after it clears those cells I would like it to hide rows 6 - 119

  2. #2
    Forum Contributor
    Join Date
    10-28-2015
    Location
    Lincolnshire, England
    MS-Off Ver
    2016
    Posts
    188

    Re: vba code to clears cells and hide rows

    Quote Originally Posted by Zimmerman View Post
    I'm looking for some help on how to clear cells and hide rows when I hit a command button. These cells do not have any formulas in them. I need to clear the following cells
    C123:H123
    C125:H125
    B109
    F109
    G109
    B94
    F94
    G94
    B79
    F79
    G79
    B64
    F64
    G64
    B49
    F49
    G49
    B34
    F34
    G34
    B19
    F19
    G19
    B4
    F4
    G4
    Then after it clears those cells I would like it to hide rows 6 - 119
    Record a macro yourself by going to the 'View' Tab in the ribbon and creating a macro. Once you give it a name, press record.

    When it's recording, click the cells you want to clear and press 'delete' -- then select the rows you want to hide and 'right click' and press 'hide'.

    stop recording the macro and then you will have the code.

    Hope this helps,

    regards,

  3. #3
    Forum Contributor
    Join Date
    07-01-2010
    Location
    Niles, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: vba code to clears cells and hide rows

    Yeah I just thought of that myself. Did what exactly what you said and it works fine. Thanks

  4. #4
    Forum Contributor
    Join Date
    10-28-2015
    Location
    Lincolnshire, England
    MS-Off Ver
    2016
    Posts
    188

    Re: vba code to clears cells and hide rows

    Quote Originally Posted by Zimmerman View Post
    Yeah I just thought of that myself. Did what exactly what you said and it works fine. Thanks
    Great, please leave reputation for me and mark thread as solved.

+ 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. [SOLVED] Auto hide/unhide rows that have empty cells ( Preferably VBA Code)
    By carlandtina02 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-09-2016, 07:06 PM
  2. [SOLVED] Code to hide rows
    By MissDB in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-09-2015, 07:31 PM
  3. code for hide rows
    By swfarm in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 04-18-2014, 11:30 AM
  4. HIDE ZEROS IN CHART - Hide rows of cells that equals zero
    By sweedey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2011, 08:18 PM
  5. Code to hide rows
    By dezmond in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-25-2011, 09:54 AM
  6. Code to hide rows = 0
    By RunHard in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-12-2009, 05:15 AM
  7. Moving section of cells clears instead!?
    By Don Wiss in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2005, 10:06 AM

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