C
CLR
Hi All.........
This formula seems to work on TEXT as well as numbers.
=IF(D10>=D9,1,0)
But, when I try to use the code below, it will not work on TEXT...yet it
works fine on numbers.......can it be fixed to work on TEXT as well?
Sub WhichSort()
Dim RNG1
Dim lastcolumn As Long, c As Long
Dim lastrow As Long, r As Long
lastcolumn = Cells(Columns.Count).End(xlToLeft).Column
For c = lastcolumn To 1 Step -1
RNG1 = c
lastrow = Cells(Rows.Count, RNG1).End(xlUp).Row
For r = lastrow To 2 Step -1
If Cells(r, RNG1) >= Cells(r, RNG1).Offset(-1, 0) Then
Cells(r, RNG1).Select
Else
GoTo 100
End If
Next r
ActiveCell.EntireColumn.Interior.ColorIndex = 4
100
Next c
MsgBox "Data sorted on the COLORED column, ASCENDING", vbOKOnly
Columns("A:M").Select
Selection.Interior.ColorIndex = xlNone
Range("F1").Select
End Sub
TIA
Vaya con Dios,
Chuck, CABGx3
This formula seems to work on TEXT as well as numbers.
=IF(D10>=D9,1,0)
But, when I try to use the code below, it will not work on TEXT...yet it
works fine on numbers.......can it be fixed to work on TEXT as well?
Sub WhichSort()
Dim RNG1
Dim lastcolumn As Long, c As Long
Dim lastrow As Long, r As Long
lastcolumn = Cells(Columns.Count).End(xlToLeft).Column
For c = lastcolumn To 1 Step -1
RNG1 = c
lastrow = Cells(Rows.Count, RNG1).End(xlUp).Row
For r = lastrow To 2 Step -1
If Cells(r, RNG1) >= Cells(r, RNG1).Offset(-1, 0) Then
Cells(r, RNG1).Select
Else
GoTo 100
End If
Next r
ActiveCell.EntireColumn.Interior.ColorIndex = 4
100
Next c
MsgBox "Data sorted on the COLORED column, ASCENDING", vbOKOnly
Columns("A:M").Select
Selection.Interior.ColorIndex = xlNone
Range("F1").Select
End Sub
TIA
Vaya con Dios,
Chuck, CABGx3