Results 1 to 3 of 3

Thread: Excel operations

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Location
    India
    Posts
    3

    Excel operations

    Hello Friends..

    I am using VB 6.0 to transfer data from *.csv ( comma deliminated excel files ) files from each row there to individual *.xls ( pure Excel files ) files for individual rows in *.csv files.

    This works fine and i get output properly as i want. But there is one problem regarding data in one coloumn.

    I have a coloumn named Date to be inserted in the resultant Excel file. I am presently sending data as pure String format data as for e.g. "07-16-04".

    I get it written there in resultant file but in the format as 7/16/2004.

    I want it to be written as 07/16/04 or 07-16-04 as such.

    its something regarding the format of the cell..

    Could anyone please help me out with this..


    Nayan

  2. #2
    PowerPoster Dave Sell's Avatar
    Join Date
    Mar 2004
    Location
    /dev/null
    Posts
    2,961
    The format of the date can be controlled by Windows itself. Try changing in in your Control Panel.

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    don't do that.... Open one if the worksheets, start recording a macro (doesn't matter what you call it). Once it is going, click the col header, Right-click, and format the dates how you want it.
    Stop the macro recording, then through the Macro menu (under Tools) Edit the macro and look at the code. You should be able to copy it, and put it into your VB app almost exactly as it it. May want to change the col that is selects to be a little more dynamic. Oh, and the object name references will need to be tewaked, but it should be obvious what needs to be what.

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width