Getting a Formula Value in an Excel Sheet to Show in a Multipage Userform Textbox

Hmerman

Board Regular
Joined
Oct 2, 2016
Messages
102
Hello,
Hope you are well.

I have the following formula in Sheet1 that matches a name and farm to give an email address:
<code>
"=INDEX(Adresboek!$C$2:$C$500,MATCH($C$8&$C$9,INDEX(Adresboek!$A$2:$A$500&Adresboek!$B$2:$B$500,),0))"
</code>

What I am trying to do is, that when I click on Page3 of a MultiPage1 it places the value of the above formula in one textbox on Page3 of the MultiPage1 and a specific email address in another textbox.
Here is my code:
<code>
Private Sub MultiPage1_Change()
'If multipage page3 is selected then fill textboxes with a formula cell value from excel sheet and specific email address.
Sheets("Sheet1").Range("C10").Value = Me.txbNa1.Text
Me.txbNa2.Text = "example@lantic.net"

End Sub
</code>

The specific email address is in the textbox when I click on Page3 of the MultiPage1, but not the formula value.

Can someone please help me with this part of my code?

Regards
Herman
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hello again,
Success!

While DuckDuckGo-ing I found the Format function as a solution on the net:
<code>
Me.txbNa1.Text = Format(Sheets("Sheet1").Range("C10"), "0")
</code>

And it works without removing the formula from the source cell, that would be the case if I set the SourceControl in the textbox properties to C10.

Regards
Herman
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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