Solved

Hide certain rows on tables

Posted on 2011-03-08
3
188 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
[X]
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
  • 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

624 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