D
daniroy
hello there and thanks in advance
I am using a string to setup a variable in VB.
The following code is working fine untill I want to introduce a variant
from i = 10 to 100
______________________________________
'GOOD CODE'
Sub Calculate()
Dim D_Y_String As String
Dim D_Y As Single
D_Y_String = "=VLOOKUP(FT!F10,D4:I10,6)"
D_Y = Application.Evaluate(D_Y_String)
End Sub
_______________________________________
To be fair, I then inject value of D_Y into another function.
The point is: here "=VLOOKUP(FT!F10,D4:I10,6)" is setup for one
specific cell FT!F10
But I will need to go through F10 to F100
There I did try the code
______________________________________
Sub Calculate()
Dim D_Y_String As String
Dim D_Y As Single
For i = 10 To 100
D_Y_String = "=VLOOKUP(Sheets("FT").Range("F"&i).Value,D4:I10,6)"
D_Y = Application.Evaluate(D_Y_String)
End Sub
_____________________________________
But obviously it is not working ... the big issue is that I do not know
how to properly introduce a variant into the vlookup code ...
Any idea and help would be, as usual, deeply appreciated!.
Thanks to everybody
regards
Daniel
I am using a string to setup a variable in VB.
The following code is working fine untill I want to introduce a variant
from i = 10 to 100
______________________________________
'GOOD CODE'
Sub Calculate()
Dim D_Y_String As String
Dim D_Y As Single
D_Y_String = "=VLOOKUP(FT!F10,D4:I10,6)"
D_Y = Application.Evaluate(D_Y_String)
End Sub
_______________________________________
To be fair, I then inject value of D_Y into another function.
The point is: here "=VLOOKUP(FT!F10,D4:I10,6)" is setup for one
specific cell FT!F10
But I will need to go through F10 to F100
There I did try the code
______________________________________
Sub Calculate()
Dim D_Y_String As String
Dim D_Y As Single
For i = 10 To 100
D_Y_String = "=VLOOKUP(Sheets("FT").Range("F"&i).Value,D4:I10,6)"
D_Y = Application.Evaluate(D_Y_String)
End Sub
_____________________________________
But obviously it is not working ... the big issue is that I do not know
how to properly introduce a variant into the vlookup code ...
Any idea and help would be, as usual, deeply appreciated!.
Thanks to everybody
regards
Daniel