View Single Post
 
Old 03-27-2022, 08:28 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Change the userform code to
Code:
Option Explicit


Private Sub CommandButton1_Click()
    Dim tmp As String
   
    If TextBox1.Text <> "" And TextBox1.Text <> TextBox1Before.Text Then
       WriteBk2 "TextBox1", TextBox1.Text
       TextBox1Before.Text = TextBox1.Text
    End If
    
    If TextBox2.Text <> "" And TextBox2.Text <> TextBox2Before.Text Then
       WriteBk2 "TextBox2", TextBox2.Text
       TextBox2Before.Text = TextBox2.Text
    End If
    
    If TextBox3.Text <> "" And TextBox3.Text <> TextBox3Before.Text Then
       WriteBk2 "TextBox3", TextBox3.Text
       TextBox3Before.Text = TextBox3.Text
    End If



    Unload Me
End Sub

Private Sub UserForm_Initialize()
        Dim tmp As String
       
        tmp = ReadBk("TextBox1")
        TextBox1.Text = tmp
        TextBox1Before.Text = tmp
        
        tmp = ReadBk("TextBox2")
        TextBox2.Text = tmp
        TextBox2Before.Text = tmp
        
        tmp = ReadBk("TextBox3")
        TextBox3.Text = tmp
        TextBox3Before.Text = tmp            
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote