![]() |
|
#2
|
||||
|
||||
|
You can't dynamically convert a string to a variable.
Let's look at the underlying reason for attempting this code. Is it intended to augment or supercede the code in your other thread? If you want to run this as a test for changes, I would be comparing a before/after value for each of the text controls. How is the userform pre-populating the controls in order to determine whether a change has occurred? You could store initial values in hidden text boxes and do a comparison of initial to current For example some aircode: Code:
Sub UserForm_Initialize()
Me.TextBox1 = "Initial value"
Me.PreTextBox1 = "Initial value" 'each visible TextBox has a hidden partner prefilled with same initial content
End Sub
Sub UserForm_Validate()
If Me.TextBox1 <> Me.PreTextBox1 then
MsgBox "A change was detected"
end if
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Generate template-based letter with multiple variables | shallaes | Word VBA | 5 | 07-12-2018 12:18 AM |
| Multiple Problems with a loop | Radtastic10 | Excel Programming | 3 | 06-09-2017 09:38 AM |
| Testing multiple values of two independant variables and charting results | sgcannon | Excel | 0 | 10-20-2015 10:10 AM |
| Array to iterate through variables and trap blank variables | Marrick13 | Word VBA | 5 | 08-04-2015 06:19 AM |
| Same values of variables in word add-in are being shared across multiple document | naq.abbas@gmail.com | Word | 0 | 01-13-2014 10:41 AM |