VBA - Textbox Link With Cell

prawln

New Member
Joined
Jul 19, 2010
Messages
6
Hey guys,

I'm trying to make a macro that has a Textbox and a button so when I add a value in the textbox it will change value in a cell.

This probably makes sence but ill explain what im doing.

In Cell F10 is a USA$ number and G10 is for NZ$. What I want to do is to be able to enter the current USA$ to NZ$ exchange in the textbox then hit a button and it will update the cell with the current dollar exchange.

The formula to do this in a cell is (this to be put in G10) =F10/0.460 (0.460 is the current exchange rate) So if F10 says $15 with the formula =F10/0.460 it would equal $32.608 NZ$.

So yeah what I want to do is enter the new exchange rate (0.460) into the text box and have it change it in cell G10.

I might be asking to much but thought I would throw it out there.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
With a textbox on a userform try like this

Code:
Private Sub CommandButton1_Click()
Range("G10").Value = Val(TextBox1.Text)
Unload Me
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,854
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top