ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   currency and textbox. (https://www.excelbanter.com/excel-programming/330242-re-currency-textbox.html)

Norie

currency and textbox.
 

How is the value being pasted to the worksheet?

Can't you just format the destination cell as Currency?


--
Norie
------------------------------------------------------------------------
Norie's Profile: http://www.excelforum.com/member.php...o&userid=19362
View this thread: http://www.excelforum.com/showthread...hreadid=374123


funkymonkUK[_9_]

currency and textbox.
 

Leith,

I have the below code

Private Sub amountofclaim_AfterUpdate()
Worksheets("data").Visible = True
cellmoney = ActiveCell.Offset(0, 21).Value
Worksheets("data").cellmoney = Format(amountofclaim.Text, "Currency")

AmountOfClaim.Value = Application.Text(AmountOfClaim.Value, "0.00")
End Sub

And it is saying object doesn't support this property or method and is
selecting the worksheets("data").cellmoney part


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=374123


Leith Ross[_16_]

currency and textbox.
 

Hello Funymonk,

You need to Dimension CellMoney as a Range. Here is the corrected
code.



Code:
--------------------
Private Sub amountofclaim_AfterUpdate()
Dim CellMoney As Range
Worksheets(\"data\").Visible = True

Set cellmoney = ActiveCell.Offset(0, 21)

Worksheets(\"data\").cellmoney.Value = Format(amountofclaim.Text, \"Currency\")

AmountOfClaim.Value = Application.Text(AmountOfClaim.Value, \"0.00\")

End Sub
--------------------


Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=374123


mangesh_yadav[_223_]

currency and textbox.
 

Hi Funkymonk

Private Sub amountofclaim_AfterUpdate()
Worksheets("data").Visible = True
cellmoney = ActiveCell.Offset(0, 21).Value

Mangesh this line will assign cellmoney with some value


Worksheets("data").cellmoney = Format(amountofclaim.Text, "Currency")

Mangesh I don't understand this line. Cellmoney is some variable, an
you should be getting the error at this line


AmountOfClaim.Value = Application.Text(AmountOfClaim.Value, "0.00")
End Sub


What is the name of the textbox. On press of the submit button yo
simply need to do something like this:
Sheet1.Range("A1") = TextBox1.Value


Manges

--
mangesh_yada
-----------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...fo&userid=1047
View this thread: http://www.excelforum.com/showthread.php?threadid=37412


mangesh_yadav[_220_]

currency and textbox.
 


Hi Funkymonk,

didn't see your last post before I posted my previous post. Good that
your problem has solved.

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=374123


funkymonkUK[_10_]

currency and textbox.
 

Mangesh you helped me with this data textbox i had which i am copyin
the code.


PHP code
-------------------
Private Sub TextBox5_Change()
' TextBox5.MaxLength = 10
Dim L

L = Len(TextBox5.Text)

If L 10 Then
MsgBox "Maximum Length is 10 Characters", vbOKOnly + vbExclamation
With TextBox5
.Text = Left(.Text, 10)
'.Text = ""
.SetFocus
End With
End If

If Len(TextBox5) = 2 Then
If Right(TextBox5, 2) 31 Then
MsgBox "Invalid date. Please enter correct value for day"
TextBox5.SetFocus
Exit Sub
Else
TextBox5 = TextBox5 & "/"
End If
End If

If Len(TextBox5) = 5 Then
If Right(TextBox5, 2) 12 Then
MsgBox "Invalid date. Please enter correct value for month"
TextBox5.SetFocus
Exit Sub
Else
TextBox5 = TextBox5 & "/"
End If
End If



End Su
-------------------


textbox5 is a date is there a way to make the cell that it goes int
realise that it is a date. i formated the cell which it does into as
date it

this is the part of the code after the user has clicked the OK butto
this happens

'Date of
ActiveCell.Offset(0, 23).Value = TextBox5.Value
TextBox5 = "

--
funkymonkU
-----------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...fo&userid=1813
View this thread: http://www.excelforum.com/showthread.php?threadid=37412


funkymonkUK[_8_]

currency and textbox.
 

it works however in the textbox like the code above says the user enters
in this 15/02/2003. (Which I would actually prefer to have as they enter
in 15/02/03 if you could help with that refer to the above code) at the
moment it is putting the date in i typed in the textbox 15/02/2003 and
it transfered it to the sheet and the format and is displaying it as
02/15/03 which I dont want i want it as dd/mm/yy


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=374123



All times are GMT +1. The time now is 03:38 AM.

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