View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
AKphidelt AKphidelt is offline
external usenet poster
 
Posts: 461
Default auto-hide & Auto-fit rows?

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!