QTP Forum


Join the forum, it's quick and easy

QTP Forum
QTP Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 


Rechercher Advanced Search

Poll
Keywords

Latest topics
» composite primary key
Excel Sorting by Rows or/and Columns (Ascending or Descending) EmptyThu Jun 19, 2014 11:31 am by thomasdfg

» How to identify the object when it is dynamically changing behavior
Excel Sorting by Rows or/and Columns (Ascending or Descending) EmptyWed Jun 18, 2014 6:37 pm by thomasdfg

» Patches for QTP 10, 11, 11.5
Excel Sorting by Rows or/and Columns (Ascending or Descending) EmptyWed Jun 18, 2014 6:04 pm by thomasdfg

» Retrieving data from Txt file into datatable
Excel Sorting by Rows or/and Columns (Ascending or Descending) EmptyWed Jun 18, 2014 5:32 pm by thomasdfg

» VB Script to count number of links in a web page.
Excel Sorting by Rows or/and Columns (Ascending or Descending) EmptyWed Jun 18, 2014 4:51 pm by thomasdfg

» Customized HTML reports in QTP
Excel Sorting by Rows or/and Columns (Ascending or Descending) EmptyWed Jun 18, 2014 4:42 pm by thomasdfg

» how to print values into a field of a web page, from a data table in qtp?
Excel Sorting by Rows or/and Columns (Ascending or Descending) EmptyWed Jun 18, 2014 4:37 pm by thomasdfg

» How to delete cookies using QTP?
Excel Sorting by Rows or/and Columns (Ascending or Descending) EmptyWed Jun 18, 2014 4:30 pm by thomasdfg

» When UFT Does Not Identify an Object
Excel Sorting by Rows or/and Columns (Ascending or Descending) EmptyWed Jun 18, 2014 4:23 pm by thomasdfg

November 2024
MonTueWedThuFriSatSun
    123
45678910
11121314151617
18192021222324
252627282930 

Calendar Calendar

Affiliates
free forum


Excel Sorting by Rows or/and Columns (Ascending or Descending)

Go down

Vote if this topic was useful to you

Excel Sorting by Rows or/and Columns (Ascending or Descending) Vote_lcap0%Excel Sorting by Rows or/and Columns (Ascending or Descending) Vote_rcap 0% 
[ 0 ]
Excel Sorting by Rows or/and Columns (Ascending or Descending) Vote_lcap0%Excel Sorting by Rows or/and Columns (Ascending or Descending) Vote_rcap 0% 
[ 0 ]
Excel Sorting by Rows or/and Columns (Ascending or Descending) Vote_lcap100%Excel Sorting by Rows or/and Columns (Ascending or Descending) Vote_rcap 100% 
[ 1 ]
Excel Sorting by Rows or/and Columns (Ascending or Descending) Vote_lcap0%Excel Sorting by Rows or/and Columns (Ascending or Descending) Vote_rcap 0% 
[ 0 ]
 
Total Votes : 1
 
 

Excel Sorting by Rows or/and Columns (Ascending or Descending) Empty Excel Sorting by Rows or/and Columns (Ascending or Descending)

Post by Gajre Mon Jul 02, 2012 2:17 am

'Represents the sorting type 1 for Ascending, and 2 for Descending.
''Excel Sorting By Colum : You may parameterise the hard coded values
Function ExcelSortByColumns()
Const xlAscending = 1
Const xlYes = 1

'Create the excel object
Set objExcel = CreateObject(“Excel.Application”)
'Make excel visible
objExcel.Visible = True
'Open the document
Set objWorkbook = objExcel.Workbooks.Open(“C:\Users\sgajre\Desktop\ListOfTopics.xls”)
'select the sheet based on the index .. 1,2 ,3 …
Set objWorksheet = objWorkbook.Worksheets(1)
'Select the range of the cells which has some data other than blank
Set objRange = objWorksheet.UsedRange
'select the column to sort
Set objRange2 = objExcel.Range(“A1″)

objRange.Sort objRange2, xlAscending, , , , , , xlYes
set objExcel=nothing
End Function

'Represents the sorting type 1 for Ascending, and 2 for Descending.
''Excel Sorting By Row: You may parameterise the hard coded values
Function ExcelSortByRows()
Const xlAscending = 1
Const xlNo = 2
Const xlSortRows = 2

Set objExcel = CreateObject(“Excel.Application”)
objExcel.Visible = True

Set objWorkbook = objExcel.Workbooks.Open(“C:\Users\sgajre\Desktop\ListOfTopics.xls”)
Set objWorksheet = objWorkbook.Worksheets(1)
objWorksheet.Cells(1,1).activate

Set objRange = objExcel.ActiveCell.EntireRow
objRange.Sort objRange, xlAscending, , , , , , xlNo, , , xlSortRows
set objExcel=nothing
End Function
Gajre
Gajre
Admin

Posts : 37
Join date : 2012-06-17
Age : 42
Location : Hyderabad

https://qtpelearning.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum