slang
02-20-2013, 08:50 AM
OK, this is probably a simple fix but I have been banging my head on this one for a while now.
I have a CSV file that I import into a sheet and run a text to columns process to slit it up. One column has date and one has time and all the data appears to be there.
Date column B = 41289
Time Column C = 0.676793981481482
When I enter a formula to combine them in column D like =B1+C1 I get the proper value of 41289.676794
The problem I have is when I copy the entire column D and paste as values in column E in VBA it always drops the time from the number (EI 41289.0)
Range("E1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks_:=False, Transpose:=False
What I am doing wrong here? I have tried number formating, paste as valueandnumberformats, etc.
Works fine manually but in code it always drops the time?
:banghead: :dunno
I have a CSV file that I import into a sheet and run a text to columns process to slit it up. One column has date and one has time and all the data appears to be there.
Date column B = 41289
Time Column C = 0.676793981481482
When I enter a formula to combine them in column D like =B1+C1 I get the proper value of 41289.676794
The problem I have is when I copy the entire column D and paste as values in column E in VBA it always drops the time from the number (EI 41289.0)
Range("E1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks_:=False, Transpose:=False
What I am doing wrong here? I have tried number formating, paste as valueandnumberformats, etc.
Works fine manually but in code it always drops the time?
:banghead: :dunno