Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Excel Sorting In VB


This statement 'ExcelRangeDistList.Sort (ExcelWSheetDistList.Columns("A")),
xlAscending' works just fine in VB6 but not in VB.NET.

Here's the bigger context:
strTheRange = "A" & CStr(BeginRange) & ":G" & CStr(TotalListRowCnt)
Set ExcelRangeDistList = ExcelWSheetDistList.Range(strTheRange)
ExcelRangeDistList.Sort (ExcelWSheetDistList.Columns("A")), xlAscending

As you can see, I am selecting a range, then sort a column A which works as
expected in VB6 but not VB.NET. I've tried several different syntaxes but
sort does not work in the .NET environment. Using the above sort statement, I
get an runtime error. I could create a VB6 com module for the Excel sort,
but that defeats the purposes of getting completely off VB6. Any ideas to try
something that might work?

--
Shapiro J.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default Excel Sorting In VB

Try this out.

http://www.developerfusion.co.uk/forums/p/25253/94127/
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Joe S" wrote:


This statement 'ExcelRangeDistList.Sort (ExcelWSheetDistList.Columns("A")),
xlAscending' works just fine in VB6 but not in VB.NET.

Here's the bigger context:
strTheRange = "A" & CStr(BeginRange) & ":G" & CStr(TotalListRowCnt)
Set ExcelRangeDistList = ExcelWSheetDistList.Range(strTheRange)
ExcelRangeDistList.Sort (ExcelWSheetDistList.Columns("A")), xlAscending

As you can see, I am selecting a range, then sort a column A which works as
expected in VB6 but not VB.NET. I've tried several different syntaxes but
sort does not work in the .NET environment. Using the above sort statement, I
get an runtime error. I could create a VB6 com module for the Excel sort,
but that defeats the purposes of getting completely off VB6. Any ideas to try
something that might work?

--
Shapiro J.

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
Sorting Values Without Sorting Formulas SBX Excel Discussion (Misc queries) 2 April 12th 09 11:17 PM
Automatic sorting (giving max and min) based on custom sorting lis Joe Lewis[_2_] Excel Worksheet Functions 4 November 23rd 08 05:12 AM
Sorting in Excel RDH Excel Worksheet Functions 5 November 19th 07 09:22 AM
Sorting VLookup vs Sorting SumProduct Lauren Excel Discussion (Misc queries) 1 August 21st 07 12:19 AM
Excel Sorting help [email protected] Excel Discussion (Misc queries) 22 September 9th 06 01:04 AM


All times are GMT +1. The time now is 01:16 PM.

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

About Us

"It's about Microsoft Excel"