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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Formatting? may be
I do a lot of subtotaling. I have different depts with diffeent charge codes but all share the same GL code. Ex Printing/Copy GL code 4400, for admin it will have a 001 extension while for the security dept it will be 002. I sort expenses based on the main GL 4400. I now have to hide a lot of rows so that my boss can see only the major expenses. I currently hide rows one by one or sector by sector. I am sure there is a short cut for this craziness. Can you help?
|
#2
|
|||
|
|||
Formatting? may be
Hopefully one of these macros will give you what you need...these are just
samples...you will have to make a few small modifications... This macro will hide all blanks in a range: Sub HideBlanks() Dim rng As Range On Error Resume Next Range("A1:A20").EntireRow.Hidden = False Set rng = Range("A1:A20").SpecialCells(xlBlanks) On Error GoTo 0 If Not rng Is Nothing Then rng.EntireRow.Hidden = True End If End Sub This macro will hide all cells that match a certain criteria in a range (obviously the criteria is “Hide Me”; get creative and change it to what you want): Sub HideRows() Dim LastRow As Long Dim i As Long ActiveSheet.UsedRange.Rows.Hidden = False LastRow = Cells(Rows.Count, 1).End(xlUp).Row For i = LastRow To 2 Step -1 If InStr(1, Cells(i, 1), "Hide Me", vbTextCompare) + _ InStr(1, Cells(i, 2), "Hide Me", vbTextCompare) Then Rows(i).Hidden = True End If Next End Sub Regards, Ryan--- "ab3d4u" wrote: I do a lot of subtotaling. I have different depts with diffeent charge codes but all share the same GL code. Ex Printing/Copy GL code 4400, for admin it will have a 001 extension while for the security dept it will be 002. I sort expenses based on the main GL 4400. I now have to hide a lot of rows so that my boss can see only the major expenses. I currently hide rows one by one or sector by sector. I am sure there is a short cut for this craziness. Can you help? -- ab3d4u |
Thread Tools | |
Display Modes | |
|
|