I am trying to pass an argument to a function where the argument is concatenated. it is not working .
Can any body help.
The function code is
------------------------------------
Function degf(ByRef x As Variant)
degf = x * 1.8 + 32
End Function
-----------------------------------
Sub temperature1()
Dim p1, p2, p3, p4, i As Integer
p1 = 2
p2 = 3
p3 = 4
p4 = 5
For i = 1 To 4
q = "p" & i
ActiveSheet.Cells(3, i) = q
ActiveSheet.Cells(4, i) = degf(q)
Next i
ActiveSheet.Cells(2, 1) = "Temperature in deg C"
ActiveSheet.Cells(2, 3) = "temperature in def"
End Sub
--------------------------------------------
when i am trying to execute an error 13 of type mismatch come.i tried several ways but not succeeded.
Please help
thanks in advance
Can any body help.
The function code is
------------------------------------
Function degf(ByRef x As Variant)
degf = x * 1.8 + 32
End Function
-----------------------------------
Sub temperature1()
Dim p1, p2, p3, p4, i As Integer
p1 = 2
p2 = 3
p3 = 4
p4 = 5
For i = 1 To 4
q = "p" & i
ActiveSheet.Cells(3, i) = q
ActiveSheet.Cells(4, i) = degf(q)
Next i
ActiveSheet.Cells(2, 1) = "Temperature in deg C"
ActiveSheet.Cells(2, 3) = "temperature in def"
End Sub
--------------------------------------------
when i am trying to execute an error 13 of type mismatch come.i tried several ways but not succeeded.
Please help
thanks in advance