Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to soft a selected range of data in Excel by using VB.Net

I'm facing a problem, I can't be able to sort a selected
range of data when I use this command in VB.Net.

Worksheet.UsedRange.Sort("A15",
XlSortOrder.xlAscending, "B15", ,
XlSortOrder.xlAscending, "C15", XlSortOrder.xlAscending,
XlYesNoGuess.xlYes, 1, False,
XlSortOrientation.xlSortColumns, XlSortMethod.xlPinYin)

is this command any wrong? please help me, thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to soft a selected range of data in Excel by using VB.Net

Here is the argument list for the sort command (from xl2000).

expression.Sort(Key1, Order1, Key2, Type, Order2, Key3, Order3, Header,
OrderCustom, MatchCase, Orientation, SortMethod)

Notice that after the first key and order, there is a type variable which
you seem to have missed.



--

Regards,

Tom Ogilvy



"Chan Ho Seng" wrote in message
...
I'm facing a problem, I can't be able to sort a selected
range of data when I use this command in VB.Net.

Worksheet.UsedRange.Sort("A15",
XlSortOrder.xlAscending, "B15", ,
XlSortOrder.xlAscending, "C15", XlSortOrder.xlAscending,
XlYesNoGuess.xlYes, 1, False,
XlSortOrientation.xlSortColumns, XlSortMethod.xlPinYin)

is this command any wrong? please help me, thanks




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to soft a selected range of data in Excel by using VB.Net

Thanks for you replying for me, What should I put in that missed *Type
Variable

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to soft a selected range of data in Excel by using VB.Net

Type Optional Variant. Specifies which elements are to be sorted. Can be
one of the following XlSortType constants: xlSortLabels or xlSortValues. Use
this argument only when sorting PivotTable reports.



Since you are not using named arguments you would at least need to use two
commas



Sort(key1,order1,,key2,order2, etc



--

Regards,

Tom Ogilvy

"Az Chan " wrote in message
...
Thanks for you replying for me, What should I put in that missed *Type*
Variable.


---
Message posted from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
can i edit only a selected range of data in an excel chart? aarho Charts and Charting in Excel 1 December 2nd 09 09:27 PM
Put data in range of selected cells MusicMaker Excel Discussion (Misc queries) 3 September 6th 07 11:55 AM
dynamic chart on user selected data range in Excel 2007 turen Charts and Charting in Excel 5 September 1st 07 02:03 AM
data validation list selected from a range Native Excel Discussion (Misc queries) 11 January 20th 06 01:11 AM


All times are GMT +1. The time now is 10:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"