+ Reply to Thread
Results 1 to 4 of 4

Hiding rows using a macro

  1. #1
    Registered User
    Join Date
    06-13-2017
    Location
    England
    MS-Off Ver
    2010
    Posts
    2

    Hiding rows using a macro

    I would like to hide a range of rows based on a number in a certain cell so for example in Cell A1 there is a number 2 so I would like to hide rows 4-31 if the number is 12 hide rows 14-31. Below is the section of code I need amending, I basically need the 14 to be cell A1 value + 2 but I cant get it to work???

    Rows("14:31").Select
    Selection.EntireRow.Hidden = True

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Hiding rows using a macro

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Hiding rows using a macro

    Is this what you want to achieve:
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Registered User
    Join Date
    06-13-2017
    Location
    England
    MS-Off Ver
    2010
    Posts
    2

    Re: Hiding rows using a macro

    Amazing that works thank you!

+ 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. Hiding columns using a macro after rows have been filtered using a macro
    By ivandc1234 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-26-2013, 06:24 PM
  2. [SOLVED] Hiding Rows using Macro
    By krishnakuma6 in forum Excel General
    Replies: 19
    Last Post: 11-14-2012, 09:17 AM
  3. VB macro hiding rows
    By kennywai in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-06-2011, 11:37 PM
  4. Macro for hiding rows
    By Cunner in forum Excel General
    Replies: 4
    Last Post: 03-04-2010, 09:55 PM
  5. Hiding Rows in a VBA macro
    By sarcher in forum Excel General
    Replies: 1
    Last Post: 05-15-2006, 10:45 AM
  6. Macro for hiding rows
    By Linda in forum Excel General
    Replies: 2
    Last Post: 02-01-2006, 05:30 PM
  7. [SOLVED] Macro for hiding rows
    By Luke in forum Excel General
    Replies: 22
    Last Post: 12-24-2005, 11:50 AM
  8. [SOLVED] hiding rows with a macro
    By Lee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-27-2005, 07: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