#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Dateformat


This just returns the daynumber, not the formati wish. Why oh Why. Please
help
With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
ActiveCell.NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Dateformat

don't you want to format the cell containing the date?

With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
.Offset(0,1).NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With

--
Regards,
Tom Ogilvy


"Kjeldc" wrote in message
...

This just returns the daynumber, not the formati wish. Why oh Why. Please
help
With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
ActiveCell.NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Dateformat

Thanks a lot. Somehow I had the idea, that .offset(0,1) WAS the activecell.

"Tom Ogilvy" skrev:

don't you want to format the cell containing the date?

With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
.Offset(0,1).NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With

--
Regards,
Tom Ogilvy


"Kjeldc" wrote in message
...

This just returns the daynumber, not the formati wish. Why oh Why. Please
help
With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
ActiveCell.NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 151
Default Dateformat

Hi all

I am getting date as number, so copied .numberformat = "dd-mm-yy"
as shown below
sh1.Cells(rw, 4) = cell.Offset(0, 13).NumberFormat = "dd-mm-yy" ' date

before i get number atleast, now i get "false". why ?
how would i get the dates coming as numbers to date formats
like "dd-mm-yy" or "dd ddd.mmm.yy"

thanks


"Tom Ogilvy" wrote:

don't you want to format the cell containing the date?

With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
.Offset(0,1).NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With

--
Regards,
Tom Ogilvy


"Kjeldc" wrote in message
...

This just returns the daynumber, not the formati wish. Why oh Why. Please
help
With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
ActiveCell.NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Dateformat

a = b = c

a will be true if b = c

you probably want
sh1.Cells(rw, 4).NumberFormat = "dd-mm-yy" ' date
or
cell.Offset(0, 13).NumberFormat = "dd-mm-yy" ' date



"Eddy Stan" wrote in message
...
Hi all

I am getting date as number, so copied .numberformat = "dd-mm-yy"
as shown below
sh1.Cells(rw, 4) = cell.Offset(0, 13).NumberFormat = "dd-mm-yy" ' date

before i get number atleast, now i get "false". why ?
how would i get the dates coming as numbers to date formats
like "dd-mm-yy" or "dd ddd.mmm.yy"

thanks


"Tom Ogilvy" wrote:

don't you want to format the cell containing the date?

With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
.Offset(0,1).NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With

--
Regards,
Tom Ogilvy


"Kjeldc" wrote in message
...

This just returns the daynumber, not the formati wish. Why oh Why.
Please
help
With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
ActiveCell.NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 151
Default Dateformat

Hi Patrick
thank you for quick & direct reply.
sh1.Cells(rw, 4).NumberFormat = "dd-mm-yy" ' date - this worked (the
otherone showed "false" message, but I understood (thanks Dave, ya it was
evaluating & transferring the result true false)

the data in sh1 is left justified, i need some more fine tuning such as
(1) centering (2) high lighted in "light yellow" if it is greater than date
at a3 in sheet sh1.

Eddy Stan


"Patrick Molloy" wrote:

a = b = c

a will be true if b = c

you probably want
sh1.Cells(rw, 4).NumberFormat = "dd-mm-yy" ' date
or
cell.Offset(0, 13).NumberFormat = "dd-mm-yy" ' date



"Eddy Stan" wrote in message
...
Hi all

I am getting date as number, so copied .numberformat = "dd-mm-yy"
as shown below
sh1.Cells(rw, 4) = cell.Offset(0, 13).NumberFormat = "dd-mm-yy" ' date

before i get number atleast, now i get "false". why ?
how would i get the dates coming as numbers to date formats
like "dd-mm-yy" or "dd ddd.mmm.yy"

thanks


"Tom Ogilvy" wrote:

don't you want to format the cell containing the date?

With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
.Offset(0,1).NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With

--
Regards,
Tom Ogilvy


"Kjeldc" wrote in message
...

This just returns the daynumber, not the formati wish. Why oh Why.
Please
help
With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
ActiveCell.NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Dateformat

You have 3 equal signs in that expression.

Excel is doing a comparison:
cell.Offset(0, 13).NumberFormat = "dd-mm-yy"
and evaluates that to true or false.

And this portion:
sh1.Cells(rw, 4)
is assigned that value

So maybe:
sh1.Cells(rw, 4) = "dd-mm-yy"
or
cell.Offset(0, 13).NumberFormat = "dd-mm-yy"

is what you want????


Eddy Stan wrote:

Hi all

I am getting date as number, so copied .numberformat = "dd-mm-yy"
as shown below
sh1.Cells(rw, 4) = cell.Offset(0, 13).NumberFormat = "dd-mm-yy" ' date

before i get number atleast, now i get "false". why ?
how would i get the dates coming as numbers to date formats
like "dd-mm-yy" or "dd ddd.mmm.yy"

thanks

"Tom Ogilvy" wrote:

don't you want to format the cell containing the date?

With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
.Offset(0,1).NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With

--
Regards,
Tom Ogilvy


"Kjeldc" wrote in message
...

This just returns the daynumber, not the formati wish. Why oh Why. Please
help
With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
ActiveCell.NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With





--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Dateformat

Time to visit the eye doctor Dave... I only see two equal signs.<g

--
Rick (MVP - Excel)


"Dave Peterson" wrote in message
...
You have 3 equal signs in that expression.

Excel is doing a comparison:
cell.Offset(0, 13).NumberFormat = "dd-mm-yy"
and evaluates that to true or false.

And this portion:
sh1.Cells(rw, 4)
is assigned that value

So maybe:
sh1.Cells(rw, 4) = "dd-mm-yy"
or
cell.Offset(0, 13).NumberFormat = "dd-mm-yy"

is what you want????


Eddy Stan wrote:

Hi all

I am getting date as number, so copied .numberformat = "dd-mm-yy"
as shown below
sh1.Cells(rw, 4) = cell.Offset(0, 13).NumberFormat = "dd-mm-yy" ' date

before i get number atleast, now i get "false". why ?
how would i get the dates coming as numbers to date formats
like "dd-mm-yy" or "dd ddd.mmm.yy"

thanks

"Tom Ogilvy" wrote:

don't you want to format the cell containing the date?

With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
.Offset(0,1).NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With

--
Regards,
Tom Ogilvy


"Kjeldc" wrote in message
...

This just returns the daynumber, not the formati wish. Why oh Why.
Please
help
With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
ActiveCell.NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With




--

Dave Peterson


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Dateformat

You're right. I was counting in base Q.


Rick Rothstein wrote:

Time to visit the eye doctor Dave... I only see two equal signs.<g

--
Rick (MVP - Excel)

"Dave Peterson" wrote in message
...
You have 3 equal signs in that expression.

Excel is doing a comparison:
cell.Offset(0, 13).NumberFormat = "dd-mm-yy"
and evaluates that to true or false.

And this portion:
sh1.Cells(rw, 4)
is assigned that value

So maybe:
sh1.Cells(rw, 4) = "dd-mm-yy"
or
cell.Offset(0, 13).NumberFormat = "dd-mm-yy"

is what you want????


Eddy Stan wrote:

Hi all

I am getting date as number, so copied .numberformat = "dd-mm-yy"
as shown below
sh1.Cells(rw, 4) = cell.Offset(0, 13).NumberFormat = "dd-mm-yy" ' date

before i get number atleast, now i get "false". why ?
how would i get the dates coming as numbers to date formats
like "dd-mm-yy" or "dd ddd.mmm.yy"

thanks

"Tom Ogilvy" wrote:

don't you want to format the cell containing the date?

With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
.Offset(0,1).NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With

--
Regards,
Tom Ogilvy


"Kjeldc" wrote in message
...

This just returns the daynumber, not the formati wish. Why oh Why.
Please
help
With ActiveCell
.Value = "*"
.Offset(0, 1).Value = DTPicker1
ActiveCell.NumberFormat = "dd-mm-yyyy"
.Offset(0, 3).Value = Val(txtMember)
End With




--

Dave Peterson


--

Dave Peterson
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
DateFormat (dd-mmm-yyyy) (dd-mmm-jjjj) Problem. Venkatachalam Excel Programming 7 November 29th 04 10:36 AM


All times are GMT +1. The time now is 12:01 AM.

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"