Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Two Quick Questions


I have so far been working on Tom's solutions.
This is what I have for Private coding in my Form:

Private Sub cmdCASH_REQUIRED_Click()
Dim Str1 As String
Str1 = txtCASH_REQUIRED.Value
Cash = Val(Str1)
Unload Me
End Sub
__________________________________________________ _______________
Private Sub grpCASH_REQUIRED_Click()
End Sub
__________________________________________________ _______________
Private Sub UserForm_Click()
End Sub
__________________________________________________ _______________
Private Sub txtCASH_REQUIRED_Exit(ByVal Cancel As
MSForms.ReturnBoolean)
txtCASH_REQUIRED.Text = Format(txtCASH_REQUIRED.Text, "#,##0")
End Sub

(I deleted the If stmt because all data input will be digital.)

Very strange ... the above coding is taking user input, converting it
to a number, and dividing it by 1,000 (when it's dropped into the WB);
however, when the Form is displayed: e.g., the user keys '10000';
after keying 'Enter', a comma is inserted between the first two zeros,
appropriately.

Tom, I think there is a typo in your second solution; I tried to fix
it, but was unsuccessful.

Thanks again,
Chuckles123


--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile: http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=278906

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Two Quick Questions

Sounds like an international decimal place issue.
I think some countries have a comma instead of a decimal place.
When you drop the value into the workbook, try converting to a number
datatype first.

eg. CDbl(txtCASH_REQUIRED.Text)



--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Chuckles123" wrote in message
...

I have so far been working on Tom's solutions.
This is what I have for Private coding in my Form:

Private Sub cmdCASH_REQUIRED_Click()
Dim Str1 As String
Str1 = txtCASH_REQUIRED.Value
Cash = Val(Str1)
Unload Me
End Sub
__________________________________________________ _______________
Private Sub grpCASH_REQUIRED_Click()
End Sub
__________________________________________________ _______________
Private Sub UserForm_Click()
End Sub
__________________________________________________ _______________
Private Sub txtCASH_REQUIRED_Exit(ByVal Cancel As
MSForms.ReturnBoolean)
txtCASH_REQUIRED.Text = Format(txtCASH_REQUIRED.Text, "#,##0")
End Sub

(I deleted the If stmt because all data input will be digital.)

Very strange ... the above coding is taking user input, converting it
to a number, and dividing it by 1,000 (when it's dropped into the WB);
however, when the Form is displayed: e.g., the user keys '10000';
after keying 'Enter', a comma is inserted between the first two zeros,
appropriately.

Tom, I think there is a typo in your second solution; I tried to fix
it, but was unsuccessful.

Thanks again,
Chuckles123


--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile:
http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=278906



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Two Quick Questions

If you have the textbox linked to a cell in the worksheet (as you appear to
describe), this is probably the source of your problem. Break the link and
write the value using code. There wasn't a typo in my suggestion I don't
believe.

--
Regards,
Tom Ogilvy

"Chuckles123" wrote in message
...

I have so far been working on Tom's solutions.
This is what I have for Private coding in my Form:

Private Sub cmdCASH_REQUIRED_Click()
Dim Str1 As String
Str1 = txtCASH_REQUIRED.Value
Cash = Val(Str1)
Unload Me
End Sub
__________________________________________________ _______________
Private Sub grpCASH_REQUIRED_Click()
End Sub
__________________________________________________ _______________
Private Sub UserForm_Click()
End Sub
__________________________________________________ _______________
Private Sub txtCASH_REQUIRED_Exit(ByVal Cancel As
MSForms.ReturnBoolean)
txtCASH_REQUIRED.Text = Format(txtCASH_REQUIRED.Text, "#,##0")
End Sub

(I deleted the If stmt because all data input will be digital.)

Very strange ... the above coding is taking user input, converting it
to a number, and dividing it by 1,000 (when it's dropped into the WB);
however, when the Form is displayed: e.g., the user keys '10000';
after keying 'Enter', a comma is inserted between the first two zeros,
appropriately.

Tom, I think there is a typo in your second solution; I tried to fix
it, but was unsuccessful.

Thanks again,
Chuckles123


--
Chuckles123
------------------------------------------------------------------------
Chuckles123's Profile:

http://www.excelforum.com/member.php...o&userid=14948
View this thread: http://www.excelforum.com/showthread...hreadid=278906



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
Quick Access Toolbar questions 3phoenix Excel Discussion (Misc queries) 1 April 23rd 07 07:34 AM
Extremely frusterated. 3 quick questions Chris Excel Worksheet Functions 6 June 17th 06 08:32 PM
two quick questions on excel. please answer as soon as possible... Microofficetester Excel Worksheet Functions 6 December 17th 04 01:42 AM
Two Quick Questions Chuckles123[_61_] Excel Programming 2 November 16th 04 04:25 AM
2 quick questions phreud[_12_] Excel Programming 6 June 18th 04 01:37 AM


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