View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Paul Paul is offline
external usenet poster
 
Posts: 10
Default Macro to insert new sheets and copy information.

Hi

I receive a huge xls file on a monthly basis. Column A is used for ID
nr only, and is always sorted.

Question: is it possible to make a macro that instert a new sheet for
each change in ID nr, and that also copy all rows with identical ID nr
to the new sheet?

Example:
Workbookname Transactions.xls
Sheet used: Januar
"Picture" of the sheet named Januar
ROW NR COLUMN A COLUMN B
1 ID NR Text
2 1 a
3 1 b
4 1 c
5 2 d
6 2 e
7 3 f
8 3 g
9 3 h


The macro should insert three new sheets named 1, 2 and 3.

"Picture" of the sheet named 1
ROW R COLUMN A COLUMN B
1 1 a
2 1 b
3 1 c


"Picture" of the sheet named 2
ROW R COLUMN A COLUMN B
1 2 d
2 2 e

"Picture" of the sheet named 3
ROW R COLUMN A COLUMN B
1 3 f
2 3 g
3 3 h

Regards,
Paul