LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Help needed with Excel VBA sort

Hi Guys,

I am trying to sort a range of cells using VBA inside an excel
application using this code:

Worksheets(ProdGeog).Range("B" & gchk1 & ":M" & gchk2).Sort _
Key1:=Worksheets(ProdGeog).Range("J" & gchk1),
Order1:=xlDescending, _
Key2:=Worksheets(ProdGeog).Range("I" & gchk1),
Order2:=xlAscending, _
Key3:=Worksheets(ProdGeog).Range("B" & gchk1),
Order3:=xlAscending, _
Header:=xlNo

This sort is used to update certain graphs in the application.

If I run the whole application, it doesn't sort properly, however if I
debug the subroutine using F8 ( step-by-step iteration), it sorts
correctly.

Any pointers as to why it doesn't do it in the first place.

Thanks,
Ravi
 
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
Search/Sort Formula Help Needed JB Excel Discussion (Misc queries) 0 February 10th 10 06:16 PM
Sort/Reference formula help needed. Scott Excel Discussion (Misc queries) 7 May 1st 09 09:24 PM
Sort/Reference formula help needed. Scott Excel Discussion (Misc queries) 1 May 1st 09 05:32 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Sort by specific word, then reg sort. (VB knowlege NEEDED) Zlord[_3_] Excel Programming 1 October 26th 05 05:10 AM


All times are GMT +1. The time now is 01:09 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"