Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.newusers
|
|||
|
|||
macro for hiding rows
Can you help me write a macro that will automatically hide every third row?
|
#2
Posted to microsoft.public.excel.newusers
|
|||
|
|||
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
Posted to microsoft.public.excel.newusers
|
|||
|
|||
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
Posted to microsoft.public.excel.newusers
|
|||
|
|||
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
Posted to microsoft.public.excel.newusers
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hiding blank rows using a macro | Excel Discussion (Misc queries) | |||
How to code Macro for hiding rows | Excel Worksheet Functions | |||
Hiding Rows in a VBA macro | Excel Discussion (Misc queries) | |||
Macro for hiding rows | Excel Discussion (Misc queries) | |||
Macro for hiding rows | Excel Discussion (Misc queries) |