Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Need Macro To Copy & Sort

Hi, below is a specification for a macro that I need coded
for Excel2000.
Many thanks in advance for any help.

Sub QUERYSORT ()

-----------------------------------------------------------
-------------------------
Sub Routine - Section1:
-----------------------------------------------------------
-------------------------
Find Range - LAST COLUMN of "Temp" worksheet that contain
text:

Find all cells that contain text and copy them
to "Results0" worksheet/columnA
Sort Cells numerically/alphabetically (RowA contains 001[*], RowB contains 002[*], etc.)

Find Range -2ND TO LAST COLUMN of "Temp" worksheet that
contain text:

Find all cells that contain "]1" and cut them
to "Results1" worksheet/columnA
Sort Cells numerically/alphabetically
Find all cells that contain "]2" and cut them
to "Results2" worksheet/columnA
Sort Cells numerically/alphabetically
Find all cells that contain "]3" and cut them
to "Results3" worksheet/columnA
Sort Cells numerically/alphabetically

-----------------------------------------------------------
-------------------------
Sub Routine - Section2:
-----------------------------------------------------------
-------------------------
Find Range - "Results3" worksheet/columnA,row2:
find exact matching cell in "Matrix" worksheet
Select MatrixWorksheet-columnsA-F of that row (the row
that contains the matching cell).
Copy cells to "Results3" worksheet/columnsB-G,row2.

Repeat this process for all rows containing text (in
the "Results3"worksheet),
copying results to the columnsB-G of the row of the cell
that was queryed.

Find/Replace: AnyStringOfNumbers LEFT of a bracket within
any cell
(example: "001[" , "002[" , etc.)
Replace: with nothing (example, Find: "001["
Replace: "" )

Find/Replace: AnyStringOfNumbers RIGHT of a bracket within
any cell
(example: "]1" , "]2" , etc.)
Replace: with nothing (example, Find: "]1"
Replace: "" )

Find/Replace: Find any commas, and replace them with a
space. (Find: "," Replace " ")

-----------------------------------------------------------
-------------------------

Repeat "Sub Routine - Section2"
for worksheets "Results2", "Results1", "Results0".

Clear the contents of "Temp"worksheet.

End Sub


Thankyou,
Jim

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
Sort / Copy Macro GoodTrouble Excel Discussion (Misc queries) 2 June 8th 09 05:02 PM
Sort, Copy, and Paste macro, must execute twice to work B. CLAY Excel Discussion (Misc queries) 2 May 26th 09 10:07 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Using Macro to sort without clicking on macro button dd Excel Discussion (Misc queries) 3 May 3rd 07 06:00 PM
Sort and copy database Charles Furtaw Excel Programming 2 September 15th 03 08:30 PM


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