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.
 

Some videos you may like

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

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
 

Watch MrExcel Video

Forum statistics

Threads
1,123,043
Messages
5,599,479
Members
414,312
Latest member
mikefire911

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