Hi,
I have a function where I need input. The Variable1 to Variable5 is the same type of input and I would like to get them into a Variable like
Dim VCol(1 To 5) As Long
Any suggestions how to make it easier?
Function CalcdataVlookup(Data_Range As Range, Target_Version As String, Variable1 As String, Variable2 As String, Variable3 As String, Variable4 As String, variable5 As String)
Dim Variable(1 To 5) As String
Dim VCol(1 To 5) As Long
Dim VTargetRow As Long
Dim i As Long
Dim ASheet As String
Dim VResult As Long
Dim VCell As Range
Variable(1) = Variable1
Variable(2) = Variable2
Variable(3) = Variable3
Variable(4) = Variable4
Variable(5) = variable5
ASheet = ActiveSheet.Name
For i = 1 To 5
If Not Variable(i) = "" Then Call FindInputColumn(VCol(i), Variable(i), ASheet, 4, Data_Range.Cells(1, 1))
Next i
I have a function where I need input. The Variable1 to Variable5 is the same type of input and I would like to get them into a Variable like
Dim VCol(1 To 5) As Long
Any suggestions how to make it easier?
Function CalcdataVlookup(Data_Range As Range, Target_Version As String, Variable1 As String, Variable2 As String, Variable3 As String, Variable4 As String, variable5 As String)
Dim Variable(1 To 5) As String
Dim VCol(1 To 5) As Long
Dim VTargetRow As Long
Dim i As Long
Dim ASheet As String
Dim VResult As Long
Dim VCell As Range
Variable(1) = Variable1
Variable(2) = Variable2
Variable(3) = Variable3
Variable(4) = Variable4
Variable(5) = variable5
ASheet = ActiveSheet.Name
For i = 1 To 5
If Not Variable(i) = "" Then Call FindInputColumn(VCol(i), Variable(i), ASheet, 4, Data_Range.Cells(1, 1))
Next i