Answer Posted / ekapop techawanto (scnyl)
The best way I found in case of your data sorting consists
of character and number, you may use Excel feature to
support this as following on:
'+++++++++++++++++++
Public Sub SCNYL_SortDataTest()
Const xlAscending = 1 'represents the sorting type 1 for
Ascending 2 for Desc
Const xlGuess = 0
Const xlTopToBottom = 1
Const xlSortNormal = 0
Const iCOLIDX_VALUE = 1 ' Set to Column "A"
Dim oExcel
Dim oWB
Dim oSheet
Dim oRange
Dim asInfo
Dim lRowIdx
Dim lMaxRows
Dim sColName
' Sample data
sValue = "eowos,bweoww, weoeos,ewsow,acc,bzaow,ceoes,
jaow, wwwowam, waosw, 1124,wowasdd, 56, 32,62,108"
' Classified to Array collection
asInfo = Split(sValue, ",")
' Refered to Excel Object
Set oExcel = CreateObject("Excel.Application")
' To make sure Excel Application already installed
If oExcel Is Nothing Then
' Clean Array Object
Erase asInfo
Exit Sub
End If
' Added a new the Workbook object
Set oWB = oExcel.Workbooks.Add
' Ignored all message window displays
oExcel.DisplayAlerts = False
Set oSheet = oWB.Worksheets(1)
' Get the Maximum of Array Object Boundary
lMaxRows = UBound(asInfo)
For lRowIdx = 0 To lMaxRows
' Loaded your data to Excel Sheet
oSheet.Cells(lRowIdx + 1, iCOLIDX_VALUE).Value =
Trim(asInfo(lRowIdx))
Next
' Set Excel Colum at "A"
sColName = "A1:A" & (lMaxRows+1)
oSheet.Range(sColName).Sort oSheet.Range("A1"),
xlAscending, , , , , , xlGuess, 1, False, xlTopToBottom, ,
xlSortNormal
' Clean Array Object
Erase asInfo
' If you'd like to array collection, you should
uncomment for the Array operation.
'ReDim Preserve asInfo(lMaxRows)
For lRowIdx = 0 To lMaxRows
With oSheet
'asInfo(lRowIdx) = .Cells(lRowIdx + 1,
iCOLIDX_VALUE).Value
Print .Cells(lRowIdx + 1,
iCOLIDX_VALUE).Value
End With
Next
' Not Save any thing for this Excel
With oWB
.Saved = False
.Close
End With
oExcel.Quit
' Restore memory allocation
Set oRange = Nothing
Set oWB = Nothing
Set oExcel = Nothing
'Erase asInfo
End Sub
'//// Main ////
Call SCNYL_SortDataTest()
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is the difference between call to existing action and copy of an action?
Explain xml checkpoints.
What are the challenges you faced during you entire life automation ?
Explain types of descriptive programming?
With what extension you can save the list of tests in a file to run in test batch runner?
what is clean sweep?
how to convert 100 into hundred repees only and viceversa
Hi, can explain the draw back of manual testing.plz send me the answer to my mail id deepthip1985@gmail.com
I want to open a Notepad window without recording a test and I do not want to use System utility Run command as well. How do I do this?
what is the frame work in J-meter?
What is the difference between analog and low level recording?
How will you test a keyboard?
How many ways we can parameterize data in quicktest professional (qtp)?
Explain the terms test and business component?
Hi all can any one give me roles and responsibilities for QTP (not WINRUNNER)