LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 54
Default Sorting VBA problem

Please help!
The problem code is as follows::

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'Change the ranges if required
If Intersect(Target, Range("D14:P20,B29:P35") Is Nothing Then Exit Sub

Application.EnableEvents = False
Application.ScreenUpdating = False

On Error GoTo GetOut

Range("D21:F21,I21:K21,N21:P21,D36:F21,I36:K21,N36 :P21").Copy

Range("T29:V21").PasteSpecial Paste:=xlValues, _
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

Range("B10,G10,L10,B25,G25,L25").Copy Destination:=Range("S29")

Application.CutCopyMode = False

Range("S29:V34").Sort Key1:=Range("S29"), _
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlLeftToRight

Target.Offset(0, 1).Select
GetOut:
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub

I received and adapted another code to fit my range.
The code is not working. I'm trying to automaticly sort three sumtotals in
different cell references (D21:P21 etc) to the relevant names (B10,G10 etc)
in a different location on the same sheet.


 
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 Problem sfar007 Excel Discussion (Misc queries) 2 June 28th 06 01:07 PM
Sorting problem . . . Hubitron2000 Excel Discussion (Misc queries) 1 March 20th 06 08:40 PM
Sorting problem man Excel Discussion (Misc queries) 1 December 8th 05 10:36 AM
Sorting problem sort trouble Excel Discussion (Misc queries) 2 June 15th 05 08:11 PM
Sorting problem Chris Excel Worksheet Functions 1 November 3rd 04 11:27 PM


All times are GMT +1. The time now is 02:15 PM.

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"