Solved

Hide certain rows on tables

Posted on 2011-03-08
3
182 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
Comment Utility
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
Comment Utility
Hi Thomas,

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

Expert Comment

by:nutsch
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
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…

772 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

15 Experts available now in Live!

Get 1:1 Help Now