0% found this document useful (0 votes)
13 views1 page

VBA Code for Data Retrieval and Sorting

The document contains two VBA subroutines for Excel. The first subroutine, 'AmbilData', retrieves data from a specified range and sets the row source for a list box based on the count of non-empty cells. The second subroutine, 'UrutData', sorts a specified range of data in descending order based on the values in column B.

Uploaded by

isnaniah16
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

VBA Code for Data Retrieval and Sorting

The document contains two VBA subroutines for Excel. The first subroutine, 'AmbilData', retrieves data from a specified range and sets the row source for a list box based on the count of non-empty cells. The second subroutine, 'UrutData', sorts a specified range of data in descending order based on the values in column B.

Uploaded by

isnaniah16
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Private Sub AmbilData()

Dim DBMAHASISWA As Long


Dim irow As Long
irow = [Link]("KOLOMDATAAWAL" & [Link]).End(xlUp).Row
DBMAHASISWA =
[Link]([Link]("CELLDATAAWAL:CELLAKHIR"))
If DBMAHASISWA = 0 Then
[Link] = ""
Else
NAMAFORM. [Link] = "NAMASHEET!CELLDATAAWAL:KOLOMAKHIR" & irow
End If
End Sub
-----------------------------------------------------------------------------------
----------
Sub UrutData()
[Link] = False
[Link]
[Link]("B5:E20000").Sort KEY1:=Range("B5"), Order1:=xlDescending,
Header:=xlYes
[Link]
End Sub

You might also like