Sort data alphabetically (A-Z) in a row

How to sort data in an alphabetical order (A to Z) in a row using Excel and VBA methods

METHOD 1. Sort data alphabetically (A-Z) in a row

EXCEL

Select data > Home tab > Sort & Filter > Custom Sort > Options > Select Sort left to right > OK > Select the Row by which to sort > Select which to Sort on > Select Order > OK

1. Select the range that captures the data you want to sort. Select range to be sorted by row

2. Select the Home tab. Select Home tab - Excel 2016

3. Click on Sort & Filter in the Editing group.
4. Click on Custom Sort.
Click on Sort & Filter and click on Custom Sort

5. Click on Options Click on Options in Sort window

6. Select Sort left to right
7. Click OK
Sort left to right and click OK

8. Select the Row by which you want to sort by.
Note: in this example we are sorting by a row that captures the product name and is titled Product List.
9. Select the Sort on type.
Note: in this example we are sorting by cell values.
10. Select A to Z from the Order drop down menu.
11. Click OK.
Select Sort by row, select Cell Values and A to Z Order

12. This image represents the result of sorting the selected data in an alphabetical order (A to Z). Sorted data alphabetically (A-Z) by row

METHOD 1. Sort data alphabetically (A-Z) in a row using VBA

VBA

Sub Sort_Alphabetically()
'declare a variables
Dim ws As Worksheet
Dim Rng As Range
Set ws = Worksheets("Sheet1")
Set Rng = ws.Range("C2:I3")
'sort data in alphabetical order (A to Z) in row 2
Rng.Sort Key1:=Range("2:2"), Order1:=xlAscending

End Sub

PREREQUISITES
Worksheet Name: Have a worksheet named Sheet1.
Data Range: In this example the data is captured in range ("C2:I3"). This range does not include headings.
Row Order: In this example the data is being sorted alphabetically by row 2, which is represented by range reference ("2:2").
ADJUSTABLE PARAMETERS
Worksheet Name: Select the worksheet that captures the data that you want sort by changing the Sheet1 worksheet name.
Data Range: Select the data range that you want to sort by changing the range reference("C2:I3").
Row Order: Select the row which you want to sort alphabetically by changing the range reference ("2:2") to any row that is within the specified range.
ADDITIONAL NOTES
Note 1: This VBA code assumes that the selected data range does not include headings.

Explanation about how to sort data alphabetically (A-Z) in a row

EXPLANATION

EXPLANATION
This tutorial explains and provides step by step instructions on how to sort data in an alphabetical order (A to Z) in a row using Excel and VBA methods.

Excel Method: This tutorial provides one example on how to sort data in an alphabetical order, in a row. This method requires changing the sort options, to sort from left to right instead of top to bottom.

VBA Method: This tutorial provides one VBA example on how to sort data in an alphabetical order, in a row.