ThrottleWorks
Excel Ninja
I am facing a strange problem.
I have used vlookup in a loop, the loop is from 3 to 64.
while running the loop, the vlookup runs for row 3 & 4 only.
Then it is giving a bug, strange the same code was populating perfect results till yestarday. Nothing has changes but i am facing the bug.
The code I am using is as below.
Dim i as long
Range("A10000").select
selection.end(xlup).select
i = activecell.row
dim rng as range
set rng = range("B3:b"&i)
dim MyVal as intenger
For each rn in rng
if rn.value <> " " then
myval = rn.row
cells((rn.row,9).resize(1,1).select
activecell.value = application.worksheetfunction.vlookup(range("b" & (MyVal)).value, workbooks("masterdata").worksheet("data").range("e:cl"),86,0)
end if
next
The macro is giving results for 2 cells then I am getting error 1004,
Can anyone help me in this please.
I have used vlookup in a loop, the loop is from 3 to 64.
while running the loop, the vlookup runs for row 3 & 4 only.
Then it is giving a bug, strange the same code was populating perfect results till yestarday. Nothing has changes but i am facing the bug.
The code I am using is as below.
Dim i as long
Range("A10000").select
selection.end(xlup).select
i = activecell.row
dim rng as range
set rng = range("B3:b"&i)
dim MyVal as intenger
For each rn in rng
if rn.value <> " " then
myval = rn.row
cells((rn.row,9).resize(1,1).select
activecell.value = application.worksheetfunction.vlookup(range("b" & (MyVal)).value, workbooks("masterdata").worksheet("data").range("e:cl"),86,0)
end if
next
The macro is giving results for 2 cells then I am getting error 1004,
Can anyone help me in this please.