A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

custom views / macros



 
 
Thread Tools Display Modes
  #1  
Old February 11th, 2009, 04:42 AM posted to microsoft.public.excel.newusers
Khardy3352
external usenet poster
 
Posts: 20
Default custom views / macros

I created a custom view from a master document that included every third row
hidden (I manually hid every third row for 1000 rows -whew!). I added a macro
that showed a particular heading row for that view, and assigned a shortcut.
I saved the worksheet as a template. The worksheet was then re-saved with a
new name, cells filled in. The custom view worked a few times, then stopped
hiding every third row in the view.
1. I don't know why the view stopped hiding the rows and
2. can you help me write a macro that will automatically hide every third
row??
  #2  
Old February 11th, 2009, 12:42 PM posted to microsoft.public.excel.newusers
CurlyDave
external usenet poster
 
Posts: 112
Default custom views / macros

This will Hide every third row starting with row 3 change the "For
i=3" to whatever row you want it to start at

Sub HideThirdRow()
fnl = Cells(65536, 1).End(xlUp).Row
For i = 3 To fnl Step 3
Cells(i, i).EntireRow.Hidden = True
Next i

End Sub

This will un-Hide the rows

Sub UnHideRows()
fnl = Cells(65536, 1).End(xlUp).Row
For i = 1 To fnl Step 2
Cells.EntireRow.Hidden = False
Next i

End Sub
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:14 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.