ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date format issue (https://www.excelbanter.com/excel-programming/346696-date-format-issue.html)

Ian

Date format issue
 
Hi all

I posted a variation on this request a couple of days back, but no-one seems
able (or willing) to solve my problem. Thsi issue is this:

I need to have the option of entering a date into a form either manually, or
from a command button. I then need that date to be transferred to a
worksheet cell. I then need to be able to compare other cells with that date
to determine if the other dates have passed.

I'm currently using a textbox on the form, but this shows the date as
mm/dd/yyyy instead of the required dd/mm/yyyy. The date on the sheet is
fine.
If I use Format(date, "dd/mm/yyyy)) to correctly display the date on the
form, the transferred date is then in text format and can no longer be
compared to on the sheet.

Any ideas how I can get round this?

--
Ian
--



Bill Kuunders

Date format issue
 
Have a look at <windows< control panel regional and language options.

--
Greetings from New Zealand
Bill K
"Ian" wrote in message
...
Hi all

I posted a variation on this request a couple of days back, but no-one
seems able (or willing) to solve my problem. Thsi issue is this:

I need to have the option of entering a date into a form either manually,
or from a command button. I then need that date to be transferred to a
worksheet cell. I then need to be able to compare other cells with that
date to determine if the other dates have passed.

I'm currently using a textbox on the form, but this shows the date as
mm/dd/yyyy instead of the required dd/mm/yyyy. The date on the sheet is
fine.
If I use Format(date, "dd/mm/yyyy)) to correctly display the date on the
form, the transferred date is then in text format and can no longer be
compared to on the sheet.

Any ideas how I can get round this?

--
Ian
--





ramesh_rajamoni

Date format issue
 

using ADO jet oledb driver -with hdr=yes set, when i try to read a excel
sheet containing numeric values in all rows from row1 , the first
numeric row is expected to appear as column header in the grid i try to
display in vb6.0, instead first row data is missing and default F1,F2..
headers are displayed. If I change first row data as text , that row
data is correctly displayed.


--
ramesh_rajamoni
------------------------------------------------------------------------
ramesh_rajamoni's Profile: http://www.excelforum.com/member.php...o&userid=29139
View this thread: http://www.excelforum.com/showthread...hreadid=488492


ramesh_rajamoni[_2_]

Date format issue
 

whenever u use format function of vb it returns a string , in this case
u need to set the format of the excel cell to which u r exporting the
date value.
if u have in a textbox some date value convert it (if necessary) to
date datatype using cdate() in vb and export to a excel cell which is
formatted as date type - use format cells option.

-RR


--
ramesh_rajamoni
------------------------------------------------------------------------
ramesh_rajamoni's Profile: http://www.excelforum.com/member.php...o&userid=29139
View this thread: http://www.excelforum.com/showthread...hreadid=488492


Ian

Date format issue
 
Thanks for the suggestion, Bill, but this is not the issue as the date in
the cell appears correctly.

The VBA Date command seems to format as mm/dd/yyyy by default. Although I
can reformat using Format(Date, "dd/mm/yyyy"), the resulting data is then
text which is no use when transferred to my sheet.

--
Ian
--
"Bill Kuunders" wrote in message
...
Have a look at <windows< control panel regional and language options.

--
Greetings from New Zealand
Bill K
"Ian" wrote in message
...
Hi all

I posted a variation on this request a couple of days back, but no-one
seems able (or willing) to solve my problem. Thsi issue is this:

I need to have the option of entering a date into a form either manually,
or from a command button. I then need that date to be transferred to a
worksheet cell. I then need to be able to compare other cells with that
date to determine if the other dates have passed.

I'm currently using a textbox on the form, but this shows the date as
mm/dd/yyyy instead of the required dd/mm/yyyy. The date on the sheet is
fine.
If I use Format(date, "dd/mm/yyyy)) to correctly display the date on the
form, the transferred date is then in text format and can no longer be
compared to on the sheet.

Any ideas how I can get round this?

--
Ian
--







Ian

Date format issue
 
Perfect!

I can leave TextBox1.Value = Format (Date, "dd/mm/yyyy") assigned to the
command button, then Range("E2") = Cdate(TextBox1.Value) is exactly what I
needed to convert the transferred data to date format.

Thank you very much.
--
Ian
--
"ramesh_rajamoni"
<ramesh_rajamoni.1z70un_1133158208.3118@excelfor um-nospam.com wrote in
message news:ramesh_rajamoni.1z70un_1133158208.3118@excelf orum-nospam.com...

whenever u use format function of vb it returns a string , in this case
u need to set the format of the excel cell to which u r exporting the
date value.
if u have in a textbox some date value convert it (if necessary) to
date datatype using cdate() in vb and export to a excel cell which is
formatted as date type - use format cells option.

-RR


--
ramesh_rajamoni
------------------------------------------------------------------------
ramesh_rajamoni's Profile:
http://www.excelforum.com/member.php...o&userid=29139
View this thread: http://www.excelforum.com/showthread...hreadid=488492





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com