Code Excel 2010

broken image


  1. Vba Code Excel 2010
  2. 2010 Excel Office
  3. Qr Code In Excel 2010

In this article, you will learn how to sort data using VBA code.

Data sorting is a daily activity which is required to perform to make data easier to understand.

Code

Add Serial Numbers. Sub AddSerialNumbers Dim i As Integer On Error GoTo Last i =. Office 2010 suites include applications such as Word, Excel, PowerPoint, and Outlook. Gba 3ds homebrew. They're available as a one-time purchase for use on a single PC. Microsoft 365 plans include premium versions of these applications plus other services that are enabled over the internet, including online storage with OneDrive and Skype minutes for home use.

Let us take an example:

We have Sales Report & we need to sort by Sales numbers
Click on Developer tab

From Code group, select Visual Basic
Click on Insert, and then Module
Battlegrounds steam discount. This will create a new module.

Enter the following code in the Module

Sub Sortdata_ascending()

Vba Code Excel 2010

Sheets(1).Range('a1:b' & Range('a1').End(xlDown).Row).Sort _

key1:=Sheets(1).Range('b:b'), order1:=xlAscending, Header:=xlYes

End Sub


Press ALT + F8 shortcut key for opening Macro window & then select the macro.
Alternatively, you can press F5 to run the code in VBA screen.

Code Excel 2010

Add Serial Numbers. Sub AddSerialNumbers Dim i As Integer On Error GoTo Last i =. Office 2010 suites include applications such as Word, Excel, PowerPoint, and Outlook. Gba 3ds homebrew. They're available as a one-time purchase for use on a single PC. Microsoft 365 plans include premium versions of these applications plus other services that are enabled over the internet, including online storage with OneDrive and Skype minutes for home use.

Let us take an example:

We have Sales Report & we need to sort by Sales numbers
Click on Developer tab

From Code group, select Visual Basic
Click on Insert, and then Module
Battlegrounds steam discount. This will create a new module.

Enter the following code in the Module

Sub Sortdata_ascending()

Vba Code Excel 2010

Sheets(1).Range('a1:b' & Range('a1').End(xlDown).Row).Sort _

key1:=Sheets(1).Range('b:b'), order1:=xlAscending, Header:=xlYes

End Sub


Press ALT + F8 shortcut key for opening Macro window & then select the macro.
Alternatively, you can press F5 to run the code in VBA screen.

The above code will sort the data in ascending order by Sales values.
To sort data in descending order by Sales value (the highest Sales will be listed at top & then goes down), we will use the following VBA code:
Sub Sortdata_descending()

Sheets(1).Range('a1:b' & Range('a1').End(xlDown).Row).Sort _

2010 Excel Office

key1:=Sheets(1).Range('b:b'), order1:=xlDescending, Header:=xlYes

Qr Code In Excel 2010

End Sub
After executing the macro, we will get the following result (Sales in Largest to Smallest)
In this way, you can sort data easily using VBA code.





broken image