Hide Tables based on user input

  • I have a setup table where users will indicate how many tables they need.


    I tried this vba code



    But it seems you can't use .Hidden with a table. Any ideas?

  • You can only hide entire rows or columns in which the table sits, you cannot hide specific cells e.g. below code


    Code
    Range("Table1").CurrentRegion.EntireRow.Hidden = True
    Range("Table1").CurrentRegion.EntireColumn.Hidden = True


    Also there is no way to hide multiple tables unless you specify a range rather than table i.e. if Table 1 to Table 3 are from column A to E and use rows 1 to 50 then code below


    Code
    'This
    Rows("1:50").Hidden = True
    Columns("A:E").Hidden = True
    
    
    'Or This
    Range("A1:E50").EntireRow.Hidden = True
    Range("A1:E50").EntireColumn.Hidden = True

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!