Solved

Hide certain rows on tables

Posted on 2011-03-08
3
184 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now