Thread: MAcro Needed
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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?