Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
MAcro Needed
How do you write a macro that takes a 7 day schedule with Employee ID
and create a csv file that shows: ID, Date, Scheduled Start Anyone have a way to take a table and then pull each column with the associated ID and stack this data? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
MAcro Needed
Pseudo code should get you started. You know the details.
Sub CreateCSV(id as String, rng as Range) Dim ff as Long, cell as Range Dim line as String, rng1 as Range ff = FreeFile() open "C:\MyFile\" & id & ".csv" for output as #ff for each cell in rng.columns(1).Cells 'Detailed code goes here set rng1 = cell.Resize(1,4) line = "" for each cell in rng1 line = line & cell.Value & "," Next line = left(line,len(line)-1) Print line Next End sub Sub StackData(id as String, rng as Range) for each cell in rng.columns(1).Cells ' detailed code goes here Next End Sub sub Tester() CreateCSV "ABCD", Range("A2:Z200") StackData "ABCD", Range("A2:Z200") End Sub -- regards, Tom Ogilvy "Nimish" wrote in message oups.com... How do you write a macro that takes a 7 day schedule with Employee ID and create a csv file that shows: ID, Date, Scheduled Start Anyone have a way to take a table and then pull each column with the associated ID and stack this data? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
error when running cut & paste macro | Excel Worksheet Functions | |||
link to combobox | Excel Discussion (Misc queries) | |||
Macro question | Excel Worksheet Functions | |||
HELP NEEDED FOR IF Function Inside a Macro | Excel Worksheet Functions | |||
Macro Help needed | Excel Discussion (Misc queries) |