Hello I have written a code for setting the range property , and it is working properly for some moment.
example below is my code.
row_no = Ydim1 * matrix - Ydim1 + matrix
Set rng1 = Range("A" & row_no & ":" & c & row_no).Find(What:=somevar, LookIn:=xlValues, Lookat:=xlWhole)
if Ydim1 is equal to 72 and matrix is equal to 1 then row equal to 1 and c =”EO” then It will work correct
if ydim1 is equal to 74 and matrix =1 then also row_no =1 only but rng1 shows nothing
thank you in advance
Welcome to debugging.
Use
to Check if your range is properly set, and check that all row numbers > 0.
Also use
to check on your lookup value.
In this particular case it would be ok to use .select in debug mode to visually check on your range.
You can achieve a similar result, using the immediate window cmd
in debug mode with a breakpoint after the line that you want to debug).
If you follow these steps, I’m quite positive that you will find the cause of your problems.