I have a workbook with about 300 worksheets in it. I want to hide row 5 in all worksheets at once.
I have a workbook with about 300 worksheets in it. I want to hide row 5 in all worksheets at once.
Is it always row5 that you want hidden?
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
redasin,
Welcome to the forum!
Give this a try:
![]()
Sub tgr() Dim ws As Worksheet For Each ws In ActiveWorkbook.Sheets ws.Rows(5).Hidden = True Next ws End Sub
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
Hi
![]()
Sub HideRowFive() Dim ws As Worksheet For Each ws In ActiveWorkbook.Sheets ws.Rows(5).Hidden = True Next ws End Sub
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star iconbelow the post.
Hi redasin,
Welcome to the forum.
Below is a quick code which can be used:-
Regards,![]()
Sub hide() For Each Sheet In ActiveWorkbook.Sheets Rows(5).Hidden = True On Error Resume Next ActiveSheet.Next.Select Next End Sub
DILIPandey
<click on below 'star' if this helps>
Last edited by arlu1201; 05-23-2012 at 02:13 PM. Reason: Thread already moved.
DILIPandey, Excel rMVP
+919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks