+ Reply to Thread
Results 1 to 3 of 3

Hiding and unhiding rows based on a CountA value

Hybrid View

juliettelam Hiding and unhiding rows... 07-15-2014, 12:09 PM
Vikas_Gautam Re: Hiding and unhiding rows... 07-15-2014, 12:18 PM
juliettelam Re: Hiding and unhiding rows... 07-15-2014, 12:23 PM
  1. #1
    Registered User
    Join Date
    07-14-2014
    Location
    nyc
    MS-Off Ver
    2003
    Posts
    74

    Hiding and unhiding rows based on a CountA value

    Hello

    I'm trying to create a macro that hides and unhides certain rows depending on a changing number.

    For example, if the countA value is 1, I want rows 1-50 to be shown on another worksheet
    If the countA value is 2, I want rows 1-100 to be shown on the other worksheet
    If the countA value is 3, I want rows 1-150 to be shown on the other worksheet
    and so on

    Does anyone know a way I can do this? Thank you

  2. #2
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Hiding and unhiding rows based on a CountA value

    Try the following..
    I am sure that will definitely help...

    Sub WorkSheet1()
    select case Range("A1").value
    case 1
    Rows("1:50").copy Sheets(2).Range("A1")
    Case 2
    Rows("1:100").copy Sheets(2).Range("A1")
    Case 3
    Rows("1:150").copy Sheets(2).Range("A1")
    end select
    msgbox "Complete!"
    End sub

    Don't forget to click *

  3. #3
    Registered User
    Join Date
    07-14-2014
    Location
    nyc
    MS-Off Ver
    2003
    Posts
    74

    Re: Hiding and unhiding rows based on a CountA value

    Hello

    Sorry I am very new to VBA, should I put this into the worksheet code or create a new macro? Also the worksheet that I am trying to do this in is called Client Reports. The number that it is referencing is in box A1 on the same client reports worksheet. So I want it to automatically show and unshow the rows based on whatever number is in box A1

    Thank you SO much 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)

Similar Threads

  1. Hiding and unhiding rows based on number of cell values
    By juliettelam in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-16-2014, 07:48 PM
  2. [SOLVED] Help hiding/unhiding rows based on multiple responses
    By mglitter1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-06-2013, 07:11 PM
  3. [SOLVED] Unhiding / Hiding rows based on a different cell value
    By gm2612 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-30-2013, 05:15 AM
  4. [SOLVED] Hiding/Unhiding Rows Based on Dropdown Box
    By SubParLlama in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-14-2012, 12:29 PM
  5. Hiding Unhiding Rows based on Text condition
    By Winner_texas in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-11-2010, 11:54 AM

Tags for this Thread

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