How is the date entered into the textbox?

perhaps Excel isn't recognizing the value as an actual "date"...

Try this:]
if (isdate(frmApplications.TextBox1.Value)) then
    ActiveCell.Value = Format(frmApplications.TextBox1.Value)) , "dd/mm/yyyy")
end if
 
I'm suspecting that the value in the textbox is being entered as a "string"
that Excel isn't recognizing as a date, so it enters it as Text.

also..
You don't really have to do all of the "selects"...
   ActiveCell.Value = Date
   ActiveCell.Offset(0, 1).Value = FrmApplications.TextBox1.Value

should work just as well.

Paul
-----------------------------------------
“Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can.” - John Wesley
-----------------------------------------




________________________________
From: Brian <brianfosterbl...@gmail.com>
To: MS EXCEL AND VBA MACROS <excel-macros@googlegroups.com>
Sent: Fri, September 9, 2011 12:56:17 PM
Subject: $$Excel-Macros$$ Date from textbox reversed.

I am using a form to enter data and then from the textbox complete
data in an excel spreadsheet.  This is my code
    ActiveCell.Value = Date
    ActiveCell.Offset(0, 1).Select
    ActiveCell.Value = FrmApplications.TextBox1.Value
    ActiveCell.Offset(0, 1).Select

Activecell.Value = Date works perfectly as it places the date in
column A correctly in the format set for my computer dd/mm/yyyy
In textbox 1 I am entering a date in the form but when this is pulled
into the cell in column B it reverses the date to mm/dd/yyyy although
my windows setting has been set to the format that appears in colmn A


How do I correct this?


I am using Excel 2007

-- 
----------------------------------------------------------------------------------

Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to