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 » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Formatting? may be



 
 
Thread Tools Display Modes
  #1  
Old November 8th, 2007, 05:46 PM
ab3d4u ab3d4u is offline
Experienced Member
 
First recorded activity by OfficeFrustration: Aug 2007
Posts: 32
Default 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  
Old November 8th, 2007, 06:40 PM posted to microsoft.public.excel.worksheet.functions
RyGuy
external usenet poster
 
Posts: 40
Default 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

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 11:33 AM.


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