#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default 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   Report Post  
Posted to microsoft.public.excel.misc
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?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error when running cut & paste macro Otto Moehrbach Excel Worksheet Functions 4 August 9th 06 01:49 PM
link to combobox legepe Excel Discussion (Misc queries) 4 July 26th 06 04:45 PM
Macro question Chris Excel Worksheet Functions 12 July 7th 06 01:23 AM
HELP NEEDED FOR IF Function Inside a Macro Sandi Excel Worksheet Functions 1 June 2nd 06 04:14 AM
Macro Help needed tamato43 Excel Discussion (Misc queries) 1 August 19th 05 01:48 AM


All times are GMT +1. The time now is 08:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"