find cell in particular column

  • Thread starter Thread starter R.VENKATARAMAN
  • Start date Start date
R

R.VENKATARAMAN

i have the same string(or number) in all the columns.
I want to find and activate the string or number in a particular column for
e.g only in column B.
ideas please
 
Dim rng as Range, rng1 as Range
Dim fAddr as String
with columns(2).Cells
set rng = .find("number")
if not rng is nothing then
fAddr = rng1.Address
Do
if rng1 is nothing then
set rng1 = rng
else
set rng1 = union(rng1,rng)
end if
set rng = .FindNext(rng)
Loop until rng.Address = fAddr
End with
if nt rng1 is nothing then
rng1.Select
End if
 
than you very much. shall use the sub

Tom Ogilvy said:
Dim rng as Range, rng1 as Range
Dim fAddr as String
with columns(2).Cells
set rng = .find("number")
if not rng is nothing then
fAddr = rng1.Address
Do
if rng1 is nothing then
set rng1 = rng
else
set rng1 = union(rng1,rng)
end if
set rng = .FindNext(rng)
Loop until rng.Address = fAddr
End with
if nt rng1 is nothing then
rng1.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