Results 1 to 3 of 3

Thread: Format cel in Excel

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2003
    Posts
    49

    Format cel in Excel

    Hi,
    When I retrieve a date type field from SQLServer and put it into Excel via VB it formats it in the number format. Anyone know the code to format it?

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    It all depends on how you put it into Excel...

    the easiest way is to put a single quote ( ' ) in front of the cell text, as Excel will treat it as text and not attempt to format it.

  3. #3
    Fanatic Member doofusboy's Avatar
    Join Date
    Apr 2003
    Posts
    526
    As said here before many times, if you're working with Excel and are not sure how to code something, start by recording a macro while manually doing what you want done [in your case formatting a cell]. Then just edit the macro to see the code for how it is done.
    Do canibals not eat clowns because they taste funny?

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