hi all!
It sometimes highlights End With and sometimes highlights Range("C2:C10001").Select
Any idea what the problem might be?
Guy xp prof xl 2007
Sub Text_on_XY()
'AutoFill
Range("C2:C2").AutoFill Destination:=Range("C2:C" & Cells(Rows.Count, "B").End(xlUp).Row)
'Paste formula result as value
Range("C2:C10001").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
'Sort 1 2 3
Range("C2:D10001").Select
ActiveWorkbook.Worksheets("Text on XY").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Text on XY").Sort.SortFields.Add Key:=Range( _
"D2:D8"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Text on XY").Sort
.SetRange Range("C2:D10001")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
It sometimes highlights End With and sometimes highlights Range("C2:C10001").Select
Any idea what the problem might be?
Guy xp prof xl 2007
Sub Text_on_XY()
'AutoFill
Range("C2:C2").AutoFill Destination:=Range("C2:C" & Cells(Rows.Count, "B").End(xlUp).Row)
'Paste formula result as value
Range("C2:C10001").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
'Sort 1 2 3
Range("C2:D10001").Select
ActiveWorkbook.Worksheets("Text on XY").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Text on XY").Sort.SortFields.Add Key:=Range( _
"D2:D8"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Text on XY").Sort
.SetRange Range("C2:D10001")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub