Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default Opening a xls for append

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Opening a xls for append

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default Opening a xls for append

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Opening a xls for append

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
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
How do you append one row to another? BobVanS Excel Worksheet Functions 3 August 30th 07 02:04 PM
What can I append David Excel Programming 6 July 19th 05 10:03 PM
how to know which row to append for the last row tango Excel Programming 2 October 16th 04 02:23 PM
Qn: How to Append??? Michael Vaughan Excel Programming 1 September 19th 04 05:32 PM
append row Joe Excel Programming 4 July 30th 04 04:47 PM


All times are GMT +1. The time now is 10:45 AM.

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

About Us

"It's about Microsoft Excel"