vangog
12-27-2021, 07:45 AM
I have code like this:
ActiveSheet.Range("A1").Select
' Sort and Autofit the 2nd column in Nemocnice
Selection.CurrentRegion.Offset(, 1).Columns(1).AutoFit
Selection.Range("B:B").Sort Order1:=xlAscending, Header:=xlN
The data are in column B, which is selected, and I could not find out how to specify the range for column B. Is it possibly. Would it be even possible to merge this code to one line?
ActiveSheet.Range("A1").Select
' Sort and Autofit the 2nd column in Nemocnice
Selection.CurrentRegion.Offset(, 1).Columns(1).AutoFit
Selection.Range("B:B").Sort Order1:=xlAscending, Header:=xlN
The data are in column B, which is selected, and I could not find out how to specify the range for column B. Is it possibly. Would it be even possible to merge this code to one line?