Hello Again! One day I’ll nail this “Select/Activate/Do Neither” issue, I swear!
Thanks to Mike on Thread707-648577 I’ve got all my UserForm data entered in a new row on sheet “Lists” as soon as the “OK” button is pressed.
Trust me to want to tart it up and get stuck again! Now I only want it to enter the data if the value in the first ComboBox doesn’t exist in Column A!
ComboBox1 is called cboSerNo, and is Tagged 1. Column A contains the dynamic Named Range “Serial_No”
The kind of thing I’m after is:
If NOT(cboSerNo.Value EXISTS IN [Serial_No]) then
ENTER THE DATA
Else
HIGHLIGHT THE ROW CONTAINING THE MATCH
LOAD THE FORM CONTROLS WITH THE VALUES FROM THAT ROW
End If
I know how to do this with an array formula in a cell:
={IF(OR($G$4=Serial_No),"Highlight","Not There"
} will detect if the value entered in $G$4 exists in the range Serial_No and result in “Highlight” if it does, and “Not There” if it ain’t. Can this be done within this data entry code?
‘ Bowers74’s most excellent code
‘
For Each ctrl In Me.Controls
If IsNumeric(ctrl.Tag) Then
i = Val(ctrl.Tag)
Cells(r, i) = ctrl.Value
End If
Next ctrl
Fingers Crossed!
Chris
Thanks to Mike on Thread707-648577 I’ve got all my UserForm data entered in a new row on sheet “Lists” as soon as the “OK” button is pressed.
Trust me to want to tart it up and get stuck again! Now I only want it to enter the data if the value in the first ComboBox doesn’t exist in Column A!
ComboBox1 is called cboSerNo, and is Tagged 1. Column A contains the dynamic Named Range “Serial_No”
The kind of thing I’m after is:
If NOT(cboSerNo.Value EXISTS IN [Serial_No]) then
ENTER THE DATA
Else
HIGHLIGHT THE ROW CONTAINING THE MATCH
LOAD THE FORM CONTROLS WITH THE VALUES FROM THAT ROW
End If
I know how to do this with an array formula in a cell:
={IF(OR($G$4=Serial_No),"Highlight","Not There"
‘ Bowers74’s most excellent code
‘
For Each ctrl In Me.Controls
If IsNumeric(ctrl.Tag) Then
i = Val(ctrl.Tag)
Cells(r, i) = ctrl.Value
End If
Next ctrl
Fingers Crossed!
Chris