Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
Rich (BB code):
Sub ref_activity()
'Stop
Dim chng As Double, cnt As Double
Dim df_o1 As String
Dim nm_fldconfig As Range, nm_gs As Range
Dim r As Integer, prow As Integer
'mbevents = False
'Stop
'define default names for activity fields
ActiveWorkbook.Names.Add Name:="nm_fldconfig", RefersTo:=ws_lists.Range("U2:U19")
ActiveWorkbook.Names.Add Name:="nm_gs", RefersTo:=ws_lists.Range("V2:V15")
'populate setup fields
With permit
If rcode Like "D*" Then
....
ElseIf rcode Like "F*" Then
With .cbx_f2_fc
.List = nm_fldconfig.Value
.Value = df_fldconfig
chk_main
End With
With .cbx_f2_gl
.List = Range("nm_gs")
Value = df_gs
chk_main
End With
.tb_f2_other.Text = df_o1
End If
End With
End Sub
The line in purple declares variable nm_fldconfig as a range
The line in green creates the named range.
Permit is the userform, cbx_f2_fc is the combox on that form.
The line in red is leaving me with an error ... "Object variable or With block variable not set."
Any thoughts on how I can correct this?