Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 13
Default macro for hiding rows

Can you help me write a macro that will automatically hide every third row?
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1,805
Default macro for hiding rows

Try

Sub hideRows()
For i = 3 To 99 Step 3
Rows(i).EntireRow.Hidden = True
Next
End Sub

Change 99 to the value you want...

"Khardy3352" wrote:

Can you help me write a macro that will automatically hide every third row?

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1,805
Default macro for hiding rows

Try

Sub hideRows()
For i = 3 To 99 Step 3
Rows(i).EntireRow.Hidden = True
Next
End Sub

Change 99 to the value you want...

"Khardy3352" wrote:

Can you help me write a macro that will automatically hide every third row?

  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3,346
Default macro for hiding rows

Hi,

Here is some code that often runs faster than loops:

Sub InsertRows()
Selection = "=1/MOD(ROW(),3)"
Selection = Selection.Value
Selection.SpecialCells(xlCellTypeConstants, 16).EntireRow.Hidden = True
Selection.EntireColumn.Delete
End Sub

Just select a blank column down as far as you want the rows to be hidden and
run it.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Khardy3352" wrote:

Can you help me write a macro that will automatically hide every third row?

  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,934
Default macro for hiding rows

Do you really want to delete the column or just clear it? My concern is if there are columns after the blank column that the user selects.

--
Rick (MVP - Excel)


"Shane Devenshire" wrote in message ...
Hi,

Here is some code that often runs faster than loops:

Sub InsertRows()
Selection = "=1/MOD(ROW(),3)"
Selection = Selection.Value
Selection.SpecialCells(xlCellTypeConstants, 16).EntireRow.Hidden = True
Selection.EntireColumn.Delete
End Sub

Just select a blank column down as far as you want the rows to be hidden and
run it.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Khardy3352" wrote:

Can you help me write a macro that will automatically hide every third row?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding blank rows using a macro GJR3599 Excel Discussion (Misc queries) 1 March 20th 07 09:22 PM
How to code Macro for hiding rows Catherine Bond Excel Worksheet Functions 4 June 24th 06 10:13 AM
Hiding Rows in a VBA macro sarcher Excel Discussion (Misc queries) 1 May 15th 06 03:39 PM
Macro for hiding rows Linda Excel Discussion (Misc queries) 2 February 1st 06 09:26 PM
Macro for hiding rows Luke Excel Discussion (Misc queries) 22 December 24th 05 03:40 PM


All times are GMT +1. The time now is 04:01 PM.

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

About Us

"It's about Microsoft Excel"