auto-hide & Auto-fit rows?
Yikes! I bet you could make my whole quote tool ten times better than it is.
"AKphidelt" wrote:
No problem, glad to help. I'm actually in Prudhoe Bay right now working on an
oil field as a financial analyst. We work 12-15 hour days, 7 days a week...
so I have a lot of free time on my hands, lol. Have a good one.
"NANGO" wrote:
I'll let you go for now. I'm not sure what I'm doing wrong. Except this is
the first time I've ever tried VBE and I've never gotten even a simple macro
to work.
Sorry to take so much time.
Thank you very much for all your help.
"AKphidelt" wrote:
Alright, don't touch anything, just copy and paste this exactly as shown in
to a regular module.
Go to the VBE and go to Insert--- Module
And then paste this in to it.
Sub HideRows()
Range("A13").Activate
Do Until ActiveCell.Address = "$A$131"
If IsEmpty(ActiveCell) Then
Selection.EntireRow.Hidden = True
ActiveCell.Offset(1,0).Activate
Else: ActiveCell.Offset(1,0).Activate
End If
Loop
End Sub
"NANGO" wrote:
Sorry, that makes the macro do nothing.
Sorry I'm not getting it right.
Thanks
"AKphidelt" wrote:
Alright change this line
Do Until ActiveCell.Rows.Count = 130
to
Do Until ActiveCell.Address = "$A$131"
Sorry
"NANGO" wrote:
Thanks for the help. The only problem is this seems to be going through
every row in the entire workbook
Sub HideRows()
Range("A13").Activate
Do Until ActiveCell.Rows.Count = 130
If IsEmpty(ActiveCell) Then
Selection.EntireRow.Hidden = True
ActiveCell.Offset(1,0).Activate
Else: ActiveCell.Offset(1,0).Activate
End If
Loop
End Sub
Any ideas?
"AKphidelt" wrote:
Nango, see if any of this works and Ill try to explain myself as I go along.
Sub HideRows()
Range("A13").Activate
Do Until ActiveCell.Rows.Count = 130
If IsEmpty(ActiveCell) Then
Selection.EntireRow.Hidden = True
ActiveCell.Offset(1,0).Activate
Else: ActiveCell.Offset(1,0).Activate
End If
Loop
End Sub
This sub will go through rows 13-130 every time and hide any row that
doesn't have a value. If you want to hide all the cells after that... add
something like this
Range(Range("A131"),Range("A131").End(xlDown).Hidd en = True
LMK what else you need
"NANGO" wrote:
I've tried a couple macro's I've seen online, but I can't seem to make a
macro work to hide lines on my worksheet.
I've got a quote worksheet with rows 13:130 available for quoting.
In column A is where the quantity gets filled in automatically from a
previous tab via a macro.
I'd like this worksheet to automatically hid the any rows on this tab that
do not have a quantity in column A.
Also, I've got my worksheet o "Auto-fit" the rows in this worksheet and the
worksheet that feeds information into it via a Macro to "Auto-Fit" rows to
the description of the product, however it doesn't happen. Any idea what I
should do here?
Many thanks!
|