Unloading Cell Value in Textbox...?

S

SIGE

Hi There,

I would like to get in my textbox the value of a certain cell on my sheet ...
If i do not like the value ...I fill in Textbox1 and write it to the same cell
Could it be that it unloads ...?

Sub Fill_Form()
Dim pform As UserForm4
Set pform = New UserForm4

Application.ScreenUpdating = False
Load pform
pform.Show
If bStop Then Exit Sub

'***** TO SUGGEST WHAT IS ALREADY FILLED IN THE FILE *****
pform.TextBox1.Value = Worksheets("General TT").Range("C3").Text
'***** To OVER-WRITE EXISTING DATA ****
Worksheets("General TT").Range("C3") = pform.TextBox1.Text


Application.ScreenUpdating = True

'Run "Save_CCard_Proposed_Name"
End Sub
 
B

Bob Phillips

Sorry, what exactly is the question?

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
T

Tom Ogilvy

You need to put the code for loading the textbox and writing back in the
events of the useform. That code doesn't run until the userform is unloaded
or hidden.

----- In the Userform Module ------------
Private Sub Userform_Initialize()
pform.TextBox1.Value = Worksheets("General TT").Range("C3").Text
end Sub

Private Sub TextBox1_Change()
Worksheets("General TT").Range("C3") = pform.TextBox1.Text
end Sub

---------------------------------------
in a general module
--------------------------------------

Sub Fill_Form()
Dim pform As UserForm4
Set pform = New UserForm4

Application.ScreenUpdating = False
Load pform
pform.Show
If bStop Then Exit Sub

Application.ScreenUpdating = True

'Run "Save_CCard_Proposed_Name"
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top