ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Column reference (https://www.excelbanter.com/excel-programming/315654-column-reference.html)

Fish

Column reference
 
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

Tom Ogilvy

Column reference
 
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

--
Regards,
Tom Ogilvy


"Fish" wrote in message
...
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





All times are GMT +1. The time now is 12:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com