Re: Sorting, one last time
- From: Dave Peterson <petersod@xxxxxxxxxxxxxxxx>
- Date: Sat, 25 Feb 2006 18:58:46 -0600
If you know it's exactly 4 columns wide, how about:
Set rng = rng.Resize(, 4)
And drop the rng1 stuff completely???
Richard wrote:
Embrassed to ask again but I've tried everything. The code is finally working
as is the command button but it's not sorting Column "D" I need it to sort
only Column's A,B,C,D
Private Sub CommandButton1_Click()
Me.CommandButton1.Caption = "Sort"
Dim rng As Range, rng1 As Range
With Worksheets("HList")
Set rng = .Range(.Cells(3, "A"), .Cells(Rows.Count, "A").End(xlUp))
Set rng1 = .Cells(3, "A").End(xlToRight)
Set rng = rng.Resize(, rng1.Column)
rng.Sort _
Key1:=.Range("A3"), _
Order1:=xlAscending, _
Header:=xlNo
End With
Application.OnTime Now + TimeSerial(0, 0, 2), _
ThisWorkbook.Name & "!ResetCaption"
CommandButton1.Caption = "Sorting..."
End Sub
--
Dave Peterson
.
- Prev by Date: Re: How do I automate the deletion of a row containing today's date i.
- Next by Date: Re: Sorting, one last time
- Previous by thread: Re: File Extensions
- Next by thread: Re: Sorting, one last time
- Index(es):