blounty
Technical User
- Mar 23, 2006
- 46
Hey All,
I am using an IF statement to get a value from a text box on a form into a cell If an adjacent cell is equal the value in a combobox on the same form. so i have used this code:
Is there anyway of shortening this code?
I appreciate any input at all. Thank you for looking.
Regards
Alex
I am using an IF statement to get a value from a text box on a form into a cell If an adjacent cell is equal the value in a combobox on the same form. so i have used this code:
Code:
Sub Analysis_Area()
If Worksheets("Proposal").Range("C4") = UserForm4.ComboBox1.Value Then
UserForm4.TextBox2.Value = Worksheets("Proposal").Range("K4")
Else
If Worksheets("Proposal").Range("C5") = UserForm4.ComboBox1.Value Then
UserForm4.TextBox2.Value = Worksheets("Proposal").Range("K5")
[COLOR=red]'This would repeat until C500 and K500!![/color]
End Sub
Is there anyway of shortening this code?
I appreciate any input at all. Thank you for looking.
Regards
Alex