Forum

Currency change in ...
 
Notifications
Clear all

Currency change in textbox userform to Sheet1

4 Posts
3 Users
0 Reactions
117 Views
(@helenw1988)
Posts: 20
Eminent Member
Topic starter
 

Hi all,

You have helped massively on a couple of issues I have had and hope that you may be able to help me again.

I have a userform with various textboxes. One of which is where the user will input the value of an invoice in to a textbox (InvoiceCost).

There is a combobox (TestCurrency) where the user selects which currency the invoice is in.

When the user presses the OK button, I would like it to combine the value of the combobox (TestCurrency) and textbox (InvoiceCost) and put it on to the sheet in column W.

Every solution I have tried either puts the symbol (£, $ or €) on to the sheet, or the value in the textbox but never both.

I have tried several solutions: -

1. Creating a third textbox which combines the value in the combobox and the textbox which does show the currency and the value but then the symbol still does not transfer on to the Sheet1 column W or converts it straight away to £.

2. Changing how the symbol is populated in the combobox with the below, to see if it was because I hadn't created the symbol properly but this doesn't transfer either

Select Case TestCurrency.Value
Case Is = "£"
InvoiceCost.Text = ChrW("&h2191")
Case Is = "€"
InvoiceCost.Text = ChrW("&h20AC")
Case Is = "$"
InvoiceCost.Text = ChrW("&h0024")
InvoiceCost.Font.Name = Abadi
End Select

3. Changing the spreadsheet columns to do a calculation based on if the symbol in the combobox equals the value in cells AA1:AA3.

Does anyone have any ideas at all?

Thank you very much!

 
Posted : 05/12/2020 6:29 am
(@debaser)
Posts: 837
Member Moderator
 

I would strongly suggest that you keep the currency code and the actual value as separate cells.

 
Posted : 05/12/2020 7:12 am
(@rhysand)
Posts: 80
Trusted Member
 

Hello,

you can attach a demo of your file and better explain what you want to happen?

 

an example to put any text in the cell without excel changing it (be it date, numbers (ex: 000123), various types of currency in the same column, ...)

 

Dim lastrow As Integer

lastrow = ActiveSheet.Cells(ActiveSheet.Rows.Count, "A").End(xlUp).Row + 1

ActiveSheet.Cells(lastrow, 1).NumberFormat = "@" ' format cell to text to accept any data without changing it
ActiveSheet.Cells(lastrow, 1).Value = Me.TextBox1.Value

 

Miguel,

 
Posted : 06/12/2020 3:49 am
(@helenw1988)
Posts: 20
Eminent Member
Topic starter
 

Hi Miguel,

Thank you so much!! Exactly what I needed 😀

 
Posted : 08/12/2020 5:18 am
Share: