+ Reply to Thread
Results 1 to 2 of 2

Variable input into F30, to point to required macro to hide rows.

  1. #1
    Registered User
    Join Date
    02-24-2021
    Location
    Guelph, Canada
    MS-Off Ver
    365
    Posts
    10

    Variable input into F30, to point to required macro to hide rows.

    Creating a geneology form. Cell F30 specifies how many children in family. This then to point to which part of the macro to operate.
    I hope the following shows requirement clearly enough.

    Option Explicit
    Sub CHILDREN_HIDE()
    With Application
    .ScreenUpdating = False
    .EnableEvents = False
    .DisplayAlerts = False
    End With

    ActiveSheet.Select
    ' Process to work on potential of 50 - 60 sheets in ONE workbook.
    ' EACH SHEET would require input into cell F30 - but not affect any other sheet.

    ' Input # of Children in Cell F30: '(Data Validation set to restrict from 0 thru 12)

    ' # of childred indicated on F30 is 12:
    ' Unhide all "children selection" sections
    ' All input sections are available - Nothing further required.

    ' If F30 = 12 then
    Range(32, 114).Select.Hidden = False 'End process

    ' # of childred indicated on F30 is 11:
    ' If F30 = 11 then
    Range(109, 114).Select.Hidden = True ' All but 12th child section showing

    ' Childred: 10
    ' If F30 = 10 then
    Range(102, 114).Select.Hidden = True ' All but 11th & 12th child section showing

    ' Childred: 9
    ' If F30 = 9 then
    Range(95, 114).Select.Hidden = True ' ETC.....................

    Range("A1").Select

    With Application
    .EnableEvents = True
    .ScreenUpdating = True
    .DisplayAlerts = True
    End With

    End Sub

    I can't figure out how to set up the Target Value Change (which I assume is required)?
    Nor how to have the correct part of the macros to be referenced/selected.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Variable input into F30, to point to required macro to hide rows.

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

+ 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. Replies: 3
    Last Post: 07-15-2016, 12:39 PM
  2. Macro required to hide or suppress Sat & Sun
    By Suzanne1307 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-07-2015, 10:12 AM
  3. [SOLVED] Help required - User input for text search and delete remaining rows
    By ssss2005 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-20-2015, 11:06 AM
  4. VBA MAcro help - using a variable starting point
    By Sadievan in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-06-2015, 01:26 PM
  5. Macro required to hide and unhide rows
    By umeshbanga in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2013, 01:02 AM
  6. Macro to hide rows based on values of input cells
    By kalts2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-06-2013, 09:28 AM
  7. Point colors of graph change when I hide rows
    By tiberiustibz in forum Excel General
    Replies: 0
    Last Post: 06-20-2011, 03:54 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