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

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
With a textbox on a userform try like this

Code:
Private Sub CommandButton1_Click()
Range("G10").Value = Val(TextBox1.Text)
Unload Me
End Sub
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,553
Messages
5,832,436
Members
430,133
Latest member
gerasimos

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
Top