Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Please help with the below macro. I have two tabs: Sheet1 & Sheet2 Sheet1 contains the below information: Columns: A B C D E Code From To Amount Group A1050 1/06/2007 5/06/2007 $ 50,000 ABC B1060 1/06/2007 5/06/2007 $ 50,000 ABC C1070 1/06/2007 5/06/2007 $ 50,000 ZZZ I need to organise these data to Sheet2 in the below format Columns: A N Q S Code Amount Group Date A1050 $ 50,000 ABC 1/06/2007 A1050 $ 50,000 ABC 2/06/2007 A1050 $ 50,000 ABC 3/06/2007 A1050 $ 50,000 ABC 4/06/2007 A1050 $ 50,000 ABC 5/06/2007 B1060 $ 50,000 ABC 1/06/2007 B1060 $ 50,000 ABC 2/06/2007 B1060 $ 50,000 ABC 3/06/2007 B1060 $ 50,000 ABC 4/06/2007 B1060 $ 50,000 ABC 5/06/2007 C1070 $ 50,000 ZZZ 1/06/2007 C1070 $ 50,000 ZZZ 2/06/2007 C1070 $ 50,000 ZZZ 3/06/2007 C1070 $ 50,000 ZZZ 4/06/2007 C1070 $ 50,000 ZZZ 5/06/2007 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Something like this for code on Worksheets(1).
Private Sub CommandButton1_Click() Dim DestRange As Range Dim Cell As Range Dim TheDate As Date Dim Counter As Long Set DestRange = Worksheets(2).Range("A1") For Each Cell In Range("B2:B4") TheDate = CDate(Cell.Value) Do Until TheDate CDate(Cell.Offset(0, 1).Value) DestRange.Offset(Counter, 0).Value = Cell.Offset(0, -1).Value DestRange.Offset(Counter, 13).Value = Cell.Offset(0, 2).Value DestRange.Offset(Counter, 16).Value = Cell.Offset(0, 3).Value DestRange.Offset(Counter, 18).Value = TheDate Counter = Counter + 1 TheDate = TheDate + 1 Loop Next End Sub NickHK "missk" wrote in message ups.com... Hi, Please help with the below macro. I have two tabs: Sheet1 & Sheet2 Sheet1 contains the below information: Columns: A B C D E Code From To Amount Group A1050 1/06/2007 5/06/2007 $ 50,000 ABC B1060 1/06/2007 5/06/2007 $ 50,000 ABC C1070 1/06/2007 5/06/2007 $ 50,000 ZZZ I need to organise these data to Sheet2 in the below format Columns: A N Q S Code Amount Group Date A1050 $ 50,000 ABC 1/06/2007 A1050 $ 50,000 ABC 2/06/2007 A1050 $ 50,000 ABC 3/06/2007 A1050 $ 50,000 ABC 4/06/2007 A1050 $ 50,000 ABC 5/06/2007 B1060 $ 50,000 ABC 1/06/2007 B1060 $ 50,000 ABC 2/06/2007 B1060 $ 50,000 ABC 3/06/2007 B1060 $ 50,000 ABC 4/06/2007 B1060 $ 50,000 ABC 5/06/2007 C1070 $ 50,000 ZZZ 1/06/2007 C1070 $ 50,000 ZZZ 2/06/2007 C1070 $ 50,000 ZZZ 3/06/2007 C1070 $ 50,000 ZZZ 4/06/2007 C1070 $ 50,000 ZZZ 5/06/2007 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Macro not showing in Tools/Macro/Macros yet show up when I goto VBA editor | Excel Programming | |||
Need syntax for RUNning a Word macro with an argument, called from an Excel macro | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |