Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

VBS copy and paste into another excel match destination formatting

$
0
0
I have been searching online for the answer to this without much luck.

1) I have an excel file that has "general" formatting. It has dates etc. etc. When it is formatted manually within the file to "text" the dates are messed up. (E.G. 3/2/2015 may turn into 112321.12)

2) When I copy the excel file into another excel file that has all the columns formatted to "Text" prior and click "match destination formatting" it will give me the contents of the first excel sheet all in "Text" format.

3) The reason I do this is because I wrote another VBS script to copy the contents into a delimited file to bulk insert it into SQL Server. However, when I bulk insert with the file produced by an excel file that isn't all "text", it will break. When I format it as "text" it works perfectly fine.

4) I need a VBS script to copy the contents of an excel document into another excel document that is formatted with text and retain its date values.

Can someone point me in the right direction or best method in doing this?

Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>