C
Corey
I am pulling data into a userform, then if needed it can be modified,
but if i make a modification i do NOT sem to get any data to change accordingly, why ?
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim rngFound As Range
On Error Resume Next
With Worksheets("Contact List").Range("A:A")
Set rngFound = .Find(What:=Me.ComboBox1.Value, After:=.Columns("A"), LookIn:=xlValues,
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, Matchbyte:=False)
If ListBox1.Value = rngFound.Offset(0, 1).Value Then
TextBox1.Value = rngFound.Offset(0, 10).Value
ComboBox2.Value = rngFound.Offset(0, 11).Value
TextBox2.Value = rngFound.Offset(0, 12).Value
TextBox3.Value = rngFound.Offset(0, 13).Value
TextBox4.Value = rngFound.Offset(0, 14).Value
TextBox5.Value = rngFound.Offset(0, 15).Value
TextBox6.Value = rngFound.Offset(0, 16).Value
TextBox7.Value = rngFound.Offset(0, 17).Value
ComboBox3.Value = rngFound.Offset(0, 18).Value
If CheckBox1 = True Then rngFound.Offset(0, 19).Value = "415v" Else rngFound.Offset(0, 19).Value
= ""
If CheckBox2 = True Then rngFound.Offset(0, 20).Value = "240v" Else rngFound.Offset(0, 20).Value
= ""
If CheckBox3 = True Then rngFound.Offset(0, 21).Value = "Other ...." Else rngFound.Offset(0,
21).Value = ""
If CheckBox4 = True Then rngFound.Offset(0, 22).Value = "GOOD" Else rngFound.Offset(0, 22).Value
= ""
If CheckBox5 = True Then rngFound.Offset(0, 23).Value = "FAIR" Else rngFound.Offset(0, 23).Value
= ""
If CheckBox6 = True Then rngFound.Offset(0, 24).Value = "POOR" Else rngFound.Offset(0, 24).Value
= ""
If CheckBox7 = True Then rngFound.Offset(0, 25).Value = "OTHER .." Else rngFound.Offset(0,
25).Value = ""
MsgBox "Done!"
Else
MsgBox "There is NO Record of that Site OR Contact Person ! ", vbCritical, " ...."
End If
End With
Unload Me
Application.ScreenUpdating = True
End Sub
Am i missing something ?
Corey....
but if i make a modification i do NOT sem to get any data to change accordingly, why ?
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Dim rngFound As Range
On Error Resume Next
With Worksheets("Contact List").Range("A:A")
Set rngFound = .Find(What:=Me.ComboBox1.Value, After:=.Columns("A"), LookIn:=xlValues,
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, Matchbyte:=False)
If ListBox1.Value = rngFound.Offset(0, 1).Value Then
TextBox1.Value = rngFound.Offset(0, 10).Value
ComboBox2.Value = rngFound.Offset(0, 11).Value
TextBox2.Value = rngFound.Offset(0, 12).Value
TextBox3.Value = rngFound.Offset(0, 13).Value
TextBox4.Value = rngFound.Offset(0, 14).Value
TextBox5.Value = rngFound.Offset(0, 15).Value
TextBox6.Value = rngFound.Offset(0, 16).Value
TextBox7.Value = rngFound.Offset(0, 17).Value
ComboBox3.Value = rngFound.Offset(0, 18).Value
If CheckBox1 = True Then rngFound.Offset(0, 19).Value = "415v" Else rngFound.Offset(0, 19).Value
= ""
If CheckBox2 = True Then rngFound.Offset(0, 20).Value = "240v" Else rngFound.Offset(0, 20).Value
= ""
If CheckBox3 = True Then rngFound.Offset(0, 21).Value = "Other ...." Else rngFound.Offset(0,
21).Value = ""
If CheckBox4 = True Then rngFound.Offset(0, 22).Value = "GOOD" Else rngFound.Offset(0, 22).Value
= ""
If CheckBox5 = True Then rngFound.Offset(0, 23).Value = "FAIR" Else rngFound.Offset(0, 23).Value
= ""
If CheckBox6 = True Then rngFound.Offset(0, 24).Value = "POOR" Else rngFound.Offset(0, 24).Value
= ""
If CheckBox7 = True Then rngFound.Offset(0, 25).Value = "OTHER .." Else rngFound.Offset(0,
25).Value = ""
MsgBox "Done!"
Else
MsgBox "There is NO Record of that Site OR Contact Person ! ", vbCritical, " ...."
End If
End With
Unload Me
Application.ScreenUpdating = True
End Sub
Am i missing something ?
Corey....