Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to look at all rows in an active sheet (from row 3 down) and
then autofit the rows. I'd like to add this to my sort macro. Here's what I've got... Sub Hospital_Sheet_Sort() Dim myRng As Range With ActiveSheet Set myRng = .Range("A3:V" & .Cells(.Rows.Count, "A").End(xlUp).Row) myRng.Sort Key1:=Range("A3"), Order1:=xlAscending, Key2:=Range("N3") _ , Order2:=xlDescending, Header:=xlNo, OrderCustom:=1, MatchCase:=False _ , Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:= _ xlSortNormal End With myRng.AutoFit.Row Range("A3:A3").Select End Sub I get an error on the myRng autofitting. I'm doing something wrong obviously... Any help would be appreciated. Thanks! --Randy Starkey |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Autofit (Columns.EntireColumn.AutoFit) does not work | Excel Discussion (Misc queries) | |||
Autofit Merged cell Code is changing the format of my merged cells | Excel Discussion (Misc queries) | |||
Need code to Autofit Row Height on recalculation | Excel Discussion (Misc queries) | |||
Code for autofit/merged cells doesn't work | Excel Programming | |||
Merged Cells Autofit - code amendment | Excel Programming |