当我运行此代码时,如果我得到匹配而不是将其放入 jackal(1) 或 jackal(2) 中,它会将其放入 Jackal(1)(0) 或 Jackal(2)(0) 中。如何重写此代码以便将值直接放入 jackal(1) 中?也许它是我的过滤器函数的语法?
Sub cmov2()
'This macro is designed to sniff out multiple selection incompatibilities; specifically if you choose a L/R Monitor Arm with L/R Swing Light it will Warn.
'Code Section#1: Find if any of the following are on the order EDS-3090, BDS-2530, or BDS-2589
Dim valid() As String
ReDim valid(1 To 3)
valid(1) = "EDS-3090"
valid(2) = "BDS-2530"
valid(3) = "BDS-2589"
Sheets("Config").Columns("B:B").Select
Selection.Find(What:="1", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Select
rowq = ActiveCell.row
Selection.End(xlDown).Select
rowp = ActiveCell.row
Range("F" & rowq).Select
Dim Stern() As String
ReDim Stern(1 To rowp - rowq)
zea = 1
Do
Stern(zea) = Selection.Value
Selection.Offset(1, 0).Select
zea = zea + 1
Loop Until zea = (rowp - rowq)
Dim quack As Integer
quack = 1
Dim jackal() As Variant
ReDim jackal(1 To 3)
Do
Stop
zee = Filter(Stern(), valid(quack))
jackal(quack) = z
quack = quack + 1
Loop Until quack = 3
' This code creates the wrong structure for this variable i get jackal(1)(0) and things 'like that. Would prefer to check jackal( 1 to end) for <> nullstring
If jackal(1)(0) = vbNullString Then
'change to y=1 do if jackal(y)<>vbnullstring then
'msgbox "warning"
Exit Sub
Else
MsgBox "Warning: You have a selection with two swingarms that are on the same radius and cannot swing past one another " & Chr$(13) & " Choose Okay if you still wish to proceed otherwise choose Cancel to revise your order", vbOKCancel
End If
End Sub