View Single Post
  #10   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Mon, 9 May 2005 01:11:05 -0700, "Magius00"
wrote:

Thanks for your help on this so far ron i think we're both on the right track
now.

here is a small sample of what i get:


01/04/2005 00:03 301 0.55 0.92 208782 345748 24
01/04/2005 00:08 301 1.32 0.91 496332 341729 47
01/04/2005 00:13 299 0.48 0.82 178567 305225 25
01/04/2005 00:18 300 0.55 0.72 204856 268616 24
01/04/2005 00:23 299 0.66 0.98 245143 367172 24

It's 5 min data the first column being a date/time the second being an
interval and then network stats.

This needs importing as is to get me.

01/02/2005 08:55 01-Feb-2005 08:55 08:00 3309
01/02/2005 09:55 01-Feb-2005 09:55 09:00 3596
01/02/2005 10:55 01-Feb-2005 10:55 10:00 3602
01/02/2005 11:59 01-Feb-2005 11:59 11:00 3887
01/02/2005 12:59 01-Feb-2005 12:59 12:00 3601


The macro i use is this:


Sub ImportNewSheet()

'Copys the table from the CSV to the eHealthGen workbook and closes the csv


Set rTable = refCell.CurrentRegion
Set NewSheet = Workbooks("ehealthgen1").Worksheets.Add
rTable.Copy (NewSheet.Range("a1"))


End Sub

The table is picked up by using a refcell and then current region and
setting this as rtable.

I then use the copy function to move the data into a workbook where another
macro does the formatting. If i could import all of these as the original
text i would be happy. Otherwise i will re-write my macro to open it as a
text file and delimit the file (already do this on some other work so not a
problem)

Thanks again
Mark


Mark,

I don't understand your examples. I don't see how you can have 01/04/2005 in
one worksheet and, when you copy it to another, you get 01/02/2005 unless you
are copying formulas and the references get screwed up and your formatting
macro does something to make it look like 2005.

If I understand you correctly, you are opening the .csv file in Excel and it
looks OK. When you copy it to another sheet, and format it, it looks strange.

Perhaps instead of using the Copy method alone, you should try Copy (with no
Destination) followed by a PasteSpecial:

rTable.Copy
NewSheet.PasteSpecial _
Paste:=xlPasteValues

Or maybe I'm not understanding your example.


--ron