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: 6
Default sorting problem

I'm someone with no VBA experience who has inherited a workbook and has to
update it.

The workbook has 3 worksheets - "Data Entry", "Intermediate", and "Output".
The user enters data in various fields in Data Entry, and the data is pulled
into Intermediate by formulas on the Intermediate worksheet. Then, the user
clicks a button to execute a VBA macro to sort the data and paste the sorted
data into the Output sheet.

This all worked fine until I had to add a new row to the Data Entry sheet. I
also added a set of corresponding formulas on the Intermediate page to pull
the new row's data over. However, when I push the Sort + Output button, the
new row is always pushed to the bottom and not sorted with the rest like it
should be.

Here's the sorting code:

Sub sortcapturepaste()
' sortcapturepaste Macro
' Keyboard Shortcut: Ctrl+q
'
Sheets("Intermediate").Select
Range("A2:S83").Select
ActiveWindow.ScrollColumn = 1
Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("A2:S83").Select
ActiveWindow.ScrollColumn = 1
Selection.Copy

Sheets("Output").Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("A2").Select

End Sub

I've also noticed that, on the Intermediate sheet, the new row's data is
displayed slightly differently - it is left-justified rather than
right-justified. I thought it was a formatting issue, but I've used format
painter on both the Data Entry sheet and on the Intermediate sheet and
nothing changed (which I thought was weird).

Any help is greatly appreciated.

Thanks,
imoose
 
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
Problem Sorting bw Excel Programming 1 March 19th 07 05:47 PM
Sorting problem Francine Excel Discussion (Misc queries) 2 July 7th 06 05:26 PM
Sorting Problem Need James[_36_] Excel Programming 6 February 5th 05 07:02 AM
Sorting problem elayem[_3_] Excel Programming 0 October 15th 04 07:51 PM


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