Hello and thank you for any attention my post may receive.
I am trying to pass the results from a input box to a ws and message box.
It works fine with pasting to the ws, however returns and error for the message box.
Any help will be greatly appreciated.
I am trying to pass the results from a input box to a ws and message box.
It works fine with pasting to the ws, however returns and error for the message box.
Any help will be greatly appreciated.
Code:
Private Sub test()
Dim s As Worksheet
Dim ar, dar, colar As Variant, x%, k%, i%, j%, cac%, slr%
Dim tra2 As String, tra As String
Set s = Sheets("SIF Reference Hidden")
tra = InputBox("Enter Tag Number", "Transmitter Tag Entry")
colar = Array(4)
cac = UBound(colar)
slr = s.Cells(Rows.Count, 4).End(xlUp).Row
x = Application.CountIf(s.Cells(1, 2).Resize(slr), tra) ' input box
ar = s.Cells(1, 1).Resize(slr, 4).Value
ReDim dar(x - 1, cac)
k = 0
For i = 1 To slr
If ar(i, 2) = tra Then
For j = 0 To cac
dar(k, j) = ar(i, colar(j))
Next j
k = k + 1
Else
End If
Next i
Sheets("test").Cells(4, 1).Resize(k, cac + 1).Value = dar
MsgBox "list: " & vbNewLine & vbNewLine & dar, vbInformation, "Welcome"
End Sub