Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Hide certain rows on tables

Posted on 2011-03-08
3
185 Views
Last Modified: 2012-05-11
Dear experts:

I got a sheet with several data lists (from 2 to n) formatted as tables.

I wonder whether it is possible to ...
... loop thru all tables and
....hide rows 3 and 6 of each table using VBA

Help is much appreciated. Thank you very much in advance.

Regards, Andreas

I have attached a sample file for your convenience.

 Hide-Rows-On-Tables.xls
0
Comment
Question by:AndreasHermle
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 500 total points
ID: 35072645
Ja, voll möglich. Try the attached code:

Sub Makro9()

Dim loTable As ListObject

For Each loTable In ActiveSheet.ListObjects
    loTable.Range.Cells(3, 1).EntireRow.Hidden = True
    loTable.Range.Cells(6, 1).EntireRow.Hidden = True
Next
End Sub

Open in new window

0
 

Author Comment

by:AndreasHermle
ID: 35073390
Hi Thomas,

super, vielen Dank. This did the trick. Great!
0
 
LVL 39

Expert Comment

by:nutsch
ID: 35073490
Glad to help. Thanks for the grade.

Thomas

PS to speed up the macro, change the screenupdating parameters


Sub Makro9()
application.screenupdating=false

Dim loTable As ListObject

For Each loTable In ActiveSheet.ListObjects
    loTable.Range.Cells(3, 1).EntireRow.Hidden = True
    loTable.Range.Cells(6, 1).EntireRow.Hidden = True
Next

application.screenupdating=true
End Sub

Open in new window

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question