Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I am using some code to put data into a sheet that will hold all users entries, but i want to to move (tab) to the next cell as at the moment it will only put the whole lot into one cell and the next lot into the next cell down and so on. Any suggestions? Open "path" & "\data.xls" For Append As #1 Print #1, Application.UserName; " Started doing task1 at "; Time() Close #1 Duncan |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would suggest to create/append a csv file (will be opened in Excel anyway).
I believe that is How your file is currently treated anyway. As a CSV this might look like this Dim TxtDelim, CellDelim TxtDelim=chr(34) CellDelim="," Open "path" & "\data.csv" For Append As #1 MyString=TxtDelim & Application.UserName & TxtDelim & CellDelim & TxtDelim & "Started doing task 1 at " &TxtDelim & CellDelim & cstr(Time()) Print #1, MyString Close #1 "Duncan" wrote: Hi all, I am using some code to put data into a sheet that will hold all users entries, but i want to to move (tab) to the next cell as at the moment it will only put the whole lot into one cell and the next lot into the next cell down and so on. Any suggestions? Open "path" & "\data.xls" For Append As #1 Print #1, Application.UserName; " Started doing task1 at "; Time() Close #1 Duncan |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Felix, that is brill, copied straight in and works perfect.
I dont know what a CSV file is and what makes it differant but at the moment that doesnt matter because I have achieved my goal for the time being! Many thanks again Duncan |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Duncan,
A CSV file is a Comma Separated Values file. i.e. what you are appending to and normally have a file extension of .csv. If you were appending your text to a real Excel file in this manner, you would end up with a corrupt workbook, as the Excel file format is binary based (BIFF8, OLEStorage or whatever). Your method works and Excel opens it because Excel can open csv file. To avoid confusion as what the file format is, it would be better to call your file(s) "Whatever.csv". NickHK "Duncan" wrote in message oups.com... Thank you Felix, that is brill, copied straight in and works perfect. I dont know what a CSV file is and what makes it differant but at the moment that doesnt matter because I have achieved my goal for the time being! Many thanks again Duncan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do you append one row to another? | Excel Worksheet Functions | |||
What can I append | Excel Programming | |||
how to know which row to append for the last row | Excel Programming | |||
Qn: How to Append??? | Excel Programming | |||
append row | Excel Programming |