ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing Years (https://www.excelbanter.com/excel-programming/433209-changing-years.html)

Doug

Changing Years
 
I built some forms in Excel 2007 and saved it compatible to 2003 on my
computer at home. When I loaded it onto our network drive at work where all
the computers have Excell 2003, some of my code didn't work. For example, I
had to change from
txtDate.Text = Format(txtDate.Text, "mmm dd, yyyy") to read
txtDate.Text = Format(txtDate.Text, "[$-409]d-mmm-yy;@")
Here 's my problem. The program works on 5 of 6 computers. On one computer
I get an error on this code...

Private Sub txtShiftTotal_Change()
txtShiftTotal.Text = Format(txtShiftTotal.Text, "$ ###,###")
End Sub

Why would 1 computer be different than the rest? Is there some add-in or
update I should be looking for?
Is there some other code I could use to format the text box to $ isth commas
and no decimals?

Thanks for any help or ideas.

Patrick Molloy[_2_]

Changing Years
 
txtDate.Text = Format(txtDate.Text, "mmm dd, yyyy")
or
txtDate.Text = Format$(txtDate.Text, "mmm dd, yyyy")
is the correct syntax for 2003 though I'd have a wrapperto trap potl errors..

If IsDate(txtDate.Text) Then
txtDate.Text = Format$(CDate(txtDate.Text), "mmm dd, yyyy")
End If

Nor do I see errors with txtShiftTotal code

I'm running just Excel 2003 sp3

sorry




"Doug" wrote:

I built some forms in Excel 2007 and saved it compatible to 2003 on my
computer at home. When I loaded it onto our network drive at work where all
the computers have Excell 2003, some of my code didn't work. For example, I
had to change from
txtDate.Text = Format(txtDate.Text, "mmm dd, yyyy") to read
txtDate.Text = Format(txtDate.Text, "[$-409]d-mmm-yy;@")
Here 's my problem. The program works on 5 of 6 computers. On one computer
I get an error on this code...

Private Sub txtShiftTotal_Change()
txtShiftTotal.Text = Format(txtShiftTotal.Text, "$ ###,###")
End Sub

Why would 1 computer be different than the rest? Is there some add-in or
update I should be looking for?
Is there some other code I could use to format the text box to $ isth commas
and no decimals?

Thanks for any help or ideas.


Doug

Changing Years
 
Thanks for the help on the date format. What can I use for the $ (dollar)
format?

"Patrick Molloy" wrote:

txtDate.Text = Format(txtDate.Text, "mmm dd, yyyy")
or
txtDate.Text = Format$(txtDate.Text, "mmm dd, yyyy")
is the correct syntax for 2003 though I'd have a wrapperto trap potl errors..

If IsDate(txtDate.Text) Then
txtDate.Text = Format$(CDate(txtDate.Text), "mmm dd, yyyy")
End If

Nor do I see errors with txtShiftTotal code

I'm running just Excel 2003 sp3

sorry




"Doug" wrote:

I built some forms in Excel 2007 and saved it compatible to 2003 on my
computer at home. When I loaded it onto our network drive at work where all
the computers have Excell 2003, some of my code didn't work. For example, I
had to change from
txtDate.Text = Format(txtDate.Text, "mmm dd, yyyy") to read
txtDate.Text = Format(txtDate.Text, "[$-409]d-mmm-yy;@")
Here 's my problem. The program works on 5 of 6 computers. On one computer
I get an error on this code...

Private Sub txtShiftTotal_Change()
txtShiftTotal.Text = Format(txtShiftTotal.Text, "$ ###,###")
End Sub

Why would 1 computer be different than the rest? Is there some add-in or
update I should be looking for?
Is there some other code I could use to format the text box to $ isth commas
and no decimals?

Thanks for any help or ideas.



All times are GMT +1. The time now is 04:14 AM.

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