update a textbox user form when user form is open

Lauren279

Board Regular
Joined
Aug 19, 2014
Messages
95
hi

i would like a textbox userform (called Ref) to update with a number with in a spreadsheet

the number is in column A and it needs to show in the textbox if in column B is blank

i have tired using

Private Sub Ref_Enter()
Ref.Text = Range("b" & Rows.Count).End(xlUp).Offset(0, -1).Value
End Sub

but nothing happens

Please Help!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
The description is thin on detail.

Based on the thread Title, if you want to populate the textbox when the userform initializes...

Code:
[color=darkblue]Private[/color] [color=darkblue]Sub[/color] [COLOR=#ff0000]UserForm_Initialize()[/COLOR]
    Ref.Text = Range("b" & Rows.Count).End(xlUp).Offset(0, -1).Value
End [color=darkblue]Sub[/color]
 
Upvote 0
thank you, i also had it has not the userform code

sorry the description was thin, i couldn't figure out how to describe the problem, but it is all fixed now and working (it was the initialize part i was missing)

thanks heaps
<o:p></o:p>
:):LOL:
 
Upvote 0

Forum statistics

Threads
1,215,149
Messages
6,123,311
Members
449,095
Latest member
Chestertim

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