Need Macro To Copy & Sort

  • Thread starter Thread starter -JB-
  • Start date Start date
J

-JB-

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
 
Back
Top