A
active_x
example: (refer help5.xls)
--------------------------------------------------
Option Explicit
Dim rNo As Integer, cNo As Integer
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
rNo = Target.Row
cNo = Target.Column
If rNo = 3 And cNo = 6 Then
fndCtmr
End If
End Sub
Private Sub fndCtmr()
Dim rCtmr As Integer
Application.EnableEvents = False
Cells(5, 6) = "" 'cls present ctmr info
Cells(7, 6) = ""
rCtmr = 2 'start of ctmr record
Do Until Cells(rCtmr, 1) = Empty 'do until the end of ctmr
list
If Cells(rCtmr, 1) = Cells(3, 6) Then 'if fnd ctmr
Exit Do
End If
rCtmr = rCtmr + 1 'chk next record in db
Loop
Cells(5, 6) = Cells(rCtmr, 2) 'fill attn
Cells(7, 6) = Cells(rCtmr, 3) 'fill tel
Application.EnableEvents = True
End Sub
"attn" and "tel". what's wrong with the sub procedures?when I select "ctmr" from the validation list, excel does NOT autofill
http://www.geocities.com/remember_it/help5.xlsif the hyperlink does not work,
TYPE(NOT CLICK) this url DIRECTLY IN THE BROWSER :
--------------------------------------------------
Option Explicit
Dim rNo As Integer, cNo As Integer
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
rNo = Target.Row
cNo = Target.Column
If rNo = 3 And cNo = 6 Then
fndCtmr
End If
End Sub
Private Sub fndCtmr()
Dim rCtmr As Integer
Application.EnableEvents = False
Cells(5, 6) = "" 'cls present ctmr info
Cells(7, 6) = ""
rCtmr = 2 'start of ctmr record
Do Until Cells(rCtmr, 1) = Empty 'do until the end of ctmr
list
If Cells(rCtmr, 1) = Cells(3, 6) Then 'if fnd ctmr
Exit Do
End If
rCtmr = rCtmr + 1 'chk next record in db
Loop
Cells(5, 6) = Cells(rCtmr, 2) 'fill attn
Cells(7, 6) = Cells(rCtmr, 3) 'fill tel
Application.EnableEvents = True
End Sub