#1   Report Post  
Dave Peterson
 
Posts: n/a
Default

I was guessing that this line:

ActiveCell.FormulaR1C1 = QuoteDay & "/" & QuoteMonth & "/" & QuoteYear

Was actually filling the cell with the value from the textbox. (But I didn't
look at the code enough to see what called what, and where
QuoteDay/QuoteMonth/QuoteYear were updated.)


with activesheet.range("H9")
If IsDate(UserForm1.TxtQuoteDay.Text) Then
.value = CDate(UserForm1.TxtQuoteDay.Text)
.NumberFormat = "mm/dd/yyyy"
Else
.value = "Not a date"
End If
end with

Although, I would suspect that it would be better to validate your date before
you try to plop it back into the worksheet.

Nigel wrote:

Hi,

It still shows the // no matter what format i change the cell to. I have
looked at your remedy but not entirely sure where to put it.

Regards,

Nigel

<<snipped
  #2   Report Post  
Nigel
 
Posts: n/a
Default

Hi,
I have solved the problem thats to your direction.

QuoteDay & "\" & QuoteMonth & "\" & QuoteYear
is what i used to use but when i changed it around to give me todays date,
( i used to select date, mont from cbo box) i forgot to edit here so the\\
was infact coming from here. now removed. no more \\ :)

Thanks,

Nigel

"Dave Peterson" wrote:

I was guessing that this line:

ActiveCell.FormulaR1C1 = QuoteDay & "/" & QuoteMonth & "/" & QuoteYear

Was actually filling the cell with the value from the textbox. (But I didn't
look at the code enough to see what called what, and where
QuoteDay/QuoteMonth/QuoteYear were updated.)


with activesheet.range("H9")
If IsDate(UserForm1.TxtQuoteDay.Text) Then
.value = CDate(UserForm1.TxtQuoteDay.Text)
.NumberFormat = "mm/dd/yyyy"
Else
.value = "Not a date"
End If
end with

Although, I would suspect that it would be better to validate your date before
you try to plop it back into the worksheet.

Nigel wrote:

Hi,

It still shows the // no matter what format i change the cell to. I have
looked at your remedy but not entirely sure where to put it.

Regards,

Nigel

<<snipped

  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

Glad you got it working.

Nigel wrote:

Hi,
I have solved the problem thats to your direction.

QuoteDay & "\" & QuoteMonth & "\" & QuoteYear
is what i used to use but when i changed it around to give me todays date,
( i used to select date, mont from cbo box) i forgot to edit here so the\\
was infact coming from here. now removed. no more \\ :)

Thanks,

Nigel

"Dave Peterson" wrote:

I was guessing that this line:

ActiveCell.FormulaR1C1 = QuoteDay & "/" & QuoteMonth & "/" & QuoteYear

Was actually filling the cell with the value from the textbox. (But I didn't
look at the code enough to see what called what, and where
QuoteDay/QuoteMonth/QuoteYear were updated.)


with activesheet.range("H9")
If IsDate(UserForm1.TxtQuoteDay.Text) Then
.value = CDate(UserForm1.TxtQuoteDay.Text)
.NumberFormat = "mm/dd/yyyy"
Else
.value = "Not a date"
End If
end with

Although, I would suspect that it would be better to validate your date before
you try to plop it back into the worksheet.

Nigel wrote:

Hi,

It still shows the // no matter what format i change the cell to. I have
looked at your remedy but not entirely sure where to put it.

Regards,

Nigel

<<snipped


--

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
How to format a date to a different format Laura Excel Discussion (Misc queries) 1 March 5th 05 09:59 PM
Date Math Problem Dkline Excel Worksheet Functions 4 March 4th 05 04:11 PM
Date format on a drop down box Steven Cheng Excel Discussion (Misc queries) 6 February 9th 05 03:13 AM
Converting numbers to date format from csv files FiBee Excel Discussion (Misc queries) 1 January 12th 05 01:30 PM
Problem with date base units for x axis Peter Carr Charts and Charting in Excel 1 December 15th 04 09:11 AM


All times are GMT +1. The time now is 05:09 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"