Column reference

  • Thread starter Thread starter Fish
  • Start date Start date
F

Fish

Group,

I am stuck within a part of my code that looks at a
static row but a dynamic Column. I am trying to make it so
each time the macro runs it looks for that cell reference
in a loop which is always located on persay the 5th row
but column always changing. Anybody have any ideas to do
this?

Thanks in advance,

Fish
 
set rng = cells(5,256).End(xltoLeft)
rng.Select

or

for each cell in Range(cells(5,1),Cells(5,256).End(xltoLeft))
if cell.Value = "testString" then
cell.Select
exit for
end if
Next

or

set rng = Range(cells(5,1),Cells(5,256).End(xltoLeft))
set cell = rng.find("TestString")
if not cell is nothing then
cell.Select
End if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top