Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Date formattting in Excel when using OLE

Hi all!

I work with OLE, and want to do this:

somecell.value = some date (which i have in mm.dd.yyyy format
numberformat = "yyyy" // year only
nextcell.value = previous cell
numberformat = "mmm" // month as name

I have tried this, but it does not work:

$WB-Sheets(1)-Cells($excel_index,1)-NumberFormat="mm.dd.yyyy";
$WB-Sheets(1)-Cells($excel_index,1)-
Value=GetMyDateFormat(odbc_result($result,3));

$WB-Sheets(1)-Cells($excel_index,1)-NumberFormat="yyyy";
$WB-Sheets(1)-Cells($excel_index,2)-NumberFormat="mm.dd.yyyy";
$WB-Sheets(1)-Cells($excel_index,2)-
Value=GetMyDateFormat(odbc_result($result,3));

$WB-Sheets(1)-Cells($excel_index,2)-NumberFormat="mmm";

GetMyDateFormat returns the date in "mm.dd.yyyy" format.

Is there an Excel guru here?

Eventually I'd like to add a date and format it as yyyy/mm

BR
Sonnich

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Date formattting in Excel when using OLE

I repost this in hope of just getting any answer....

also, how come, that the format #0.00 only works sometimes?
It should be the same always

On Mar 30, 3:56 pm, "jodleren" wrote:
Hi all!

I work with OLE, and want to do this:

somecell.value = some date (which i have in mm.dd.yyyy format
numberformat = "yyyy" // year only
nextcell.value = previous cell
numberformat = "mmm" // month as name

I have tried this, but it does not work:

$WB-Sheets(1)-Cells($excel_index,1)-NumberFormat="mm.dd.yyyy";
$WB-Sheets(1)-Cells($excel_index,1)-Value=GetMyDateFormat(odbc_result($result,3));

$WB-Sheets(1)-Cells($excel_index,1)-NumberFormat="yyyy";
$WB-Sheets(1)-Cells($excel_index,2)-NumberFormat="mm.dd.yyyy";
$WB-Sheets(1)-Cells($excel_index,2)-Value=GetMyDateFormat(odbc_result($result,3));

$WB-Sheets(1)-Cells($excel_index,2)-NumberFormat="mmm";

GetMyDateFormat returns the date in "mm.dd.yyyy" format.

Is there an Excel guru here?

Eventually I'd like to add a date and format it as yyyy/mm

BRSonnich



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formattting kaci Excel Discussion (Misc queries) 5 May 6th 09 01:15 PM
Conditional formattting & CountColorCells Neil Pearce Excel Discussion (Misc queries) 6 February 21st 08 02:02 PM
Formattting Text Donovan[_2_] Excel Worksheet Functions 1 June 6th 07 03:41 PM
Excel Formula to calulate number of days passed from date to date K. Mack Excel Discussion (Misc queries) 8 January 4th 07 11:27 PM
Formattting Fractions MarthaSue Excel Discussion (Misc queries) 3 May 2nd 05 06:54 AM


All times are GMT +1. The time now is 03:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"