Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
I am using custom views from a master document to filter information. I would
like to hide evry 2nd & 3rd row. Because the document has approx 2000+ rows, is there a way to do so without recording a macro while I manually hide every 2nd & 3rd row? Be kind, I am a rookie |
#2
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Sub hiderows()
For i = Cells(rows.Count, "a").End(xlUp).row To 2 Step -3 rows(i).Hidden = True Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Khardy3352" wrote in message ... I am using custom views from a master document to filter information. I would like to hide evry 2nd & 3rd row. Because the document has approx 2000+ rows, is there a way to do so without recording a macro while I manually hide every 2nd & 3rd row? Be kind, I am a rookie |
#3
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Mr Guillet
Thank you . Because I am so new at this, the only macros I have used are those which I record. My assumption is that once I have the desired columns hidden, I select tools - macros-create-type a name- copy and paste this in the window that comes up when I select create. What do I do to taylor it to my document? I want to add a keyboard shortcut as well (i.e. ctrl+p to open the view instead of using the menu) "Don Guillett" wrote: Sub hiderows() For i = Cells(rows.Count, "a").End(xlUp).row To 2 Step -3 rows(i).Hidden = True Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Khardy3352" wrote in message ... I am using custom views from a master document to filter information. I would like to hide evry 2nd & 3rd row. Because the document has approx 2000+ rows, is there a way to do so without recording a macro while I manually hide every 2nd & 3rd row? Be kind, I am a rookie |
#4
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Alt + F11 to open the VB Editor.
CTRL + r to open the Project Explorer. Select your workbook/project and right-clickinsertmodule. Paste the code into that module. You may want to revise the code to hide every 2nd and 3rd row which I assume is rows 2,3,5,6,8,9 etc. Sub hiderows() For i = Cells(Rows.Count, "a").End(xlUp).Row - 1 To 2 Step -3 Rows(i).Resize(2).Hidden = True Next i End Sub Alt + q to return to the Excel window. ToolsMacroMacros and select your hiderows macro name and "Options" Enter your shortcut key here and OK. Gord Dibben MS Excel MVP On Sat, 26 Jul 2008 11:53:00 -0700, Khardy3352 wrote: Mr Guillet Thank you . Because I am so new at this, the only macros I have used are those which I record. My assumption is that once I have the desired columns hidden, I select tools - macros-create-type a name- copy and paste this in the window that comes up when I select create. What do I do to taylor it to my document? I want to add a keyboard shortcut as well (i.e. ctrl+p to open the view instead of using the menu) "Don Guillett" wrote: Sub hiderows() For i = Cells(rows.Count, "a").End(xlUp).row To 2 Step -3 rows(i).Hidden = True Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Khardy3352" wrote in message ... I am using custom views from a master document to filter information. I would like to hide evry 2nd & 3rd row. Because the document has approx 2000+ rows, is there a way to do so without recording a macro while I manually hide every 2nd & 3rd row? Be kind, I am a rookie |
#5
![]()
Posted to microsoft.public.excel.newusers
|
|||
|
|||
![]()
Thank you so much for your explanation. I appreciate your help!
"Gord Dibben" wrote: Alt + F11 to open the VB Editor. CTRL + r to open the Project Explorer. Select your workbook/project and right-clickinsertmodule. Paste the code into that module. You may want to revise the code to hide every 2nd and 3rd row which I assume is rows 2,3,5,6,8,9 etc. Sub hiderows() For i = Cells(Rows.Count, "a").End(xlUp).Row - 1 To 2 Step -3 Rows(i).Resize(2).Hidden = True Next i End Sub Alt + q to return to the Excel window. ToolsMacroMacros and select your hiderows macro name and "Options" Enter your shortcut key here and OK. Gord Dibben MS Excel MVP On Sat, 26 Jul 2008 11:53:00 -0700, Khardy3352 wrote: Mr Guillet Thank you . Because I am so new at this, the only macros I have used are those which I record. My assumption is that once I have the desired columns hidden, I select tools - macros-create-type a name- copy and paste this in the window that comes up when I select create. What do I do to taylor it to my document? I want to add a keyboard shortcut as well (i.e. ctrl+p to open the view instead of using the menu) "Don Guillett" wrote: Sub hiderows() For i = Cells(rows.Count, "a").End(xlUp).row To 2 Step -3 rows(i).Hidden = True Next i End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Khardy3352" wrote in message ... I am using custom views from a master document to filter information. I would like to hide evry 2nd & 3rd row. Because the document has approx 2000+ rows, is there a way to do so without recording a macro while I manually hide every 2nd & 3rd row? Be kind, I am a rookie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Looking for code to separate one line of text into multiple lines in Excel | Excel Worksheet Functions | |||
How Do I Add Multiple Lines On Secondary Axis in Excel Chart? | Charts and Charting in Excel | |||
Hiding rows that meet multiple conditions in excel | Excel Discussion (Misc queries) | |||
How do I get multiple lines of text in a Excel cell? | Excel Discussion (Misc queries) | |||
how do I enter multiple lines in a cell in Excel | Excel Discussion (Misc queries) |