ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   new comer problems (https://www.excelbanter.com/excel-programming/285769-new-comer-problems.html)

Eitan[_2_]

new comer problems
 
Hi,

I am new to the Excell environment. I am trying to use the find method
from a visual basic program and i want to start the search after a
given cell. The code is something like this


Set c = .Range("b2").EntireColumn.Find(strItemCode, , , xlWhole)

The address i have from which I want the search to begin is a result
of a previous search. specifically it is c.address (the same c that
appears in the code). I didn't succeed to use this address as the
after parameter for the next find. How can i use this address? I am
sure I am doing something wrong but I just don't know what.

Thanks for the help.

Don Guillett[_4_]

new comer problems
 
maybe
Set c = .Range("b2").EntireColumn.Find(strItemCode, , , xlWhole


Sub findafter()
strItemCode = "a"
With ActiveSheet
Set c = .Columns(2).Find(strItemCode, after:=Range("b2"))
End With
MsgBox c.Address
End Sub


--
Don Guillett
SalesAid Software

"Eitan" wrote in message
om...
Hi,

I am new to the Excell environment. I am trying to use the find method
from a visual basic program and i want to start the search after a
given cell. The code is something like this


Set c = .Range("b2").EntireColumn.Find(strItemCode, , , xlWhole)

The address i have from which I want the search to begin is a result
of a previous search. specifically it is c.address (the same c that
appears in the code). I didn't succeed to use this address as the
after parameter for the next find. How can i use this address? I am
sure I am doing something wrong but I just don't know what.

Thanks for the help.




Izar Arcturus

new comer problems
 
Try this:

Private Sub FindItAfter_C_Address()
Set c = Cells.Find(what:=strItemCode, _
after:=c.Address, LookIn:= xlValues, _
LookAt:=xlWhole, Searchorder:=xlByRows)
End Sub

-IA

-----Original Message-----
Hi,

I am new to the Excell environment. I am trying to use

the find method
from a visual basic program and i want to start the

search after a
given cell. The code is something like this


Set c = .Range("b2").EntireColumn.Find(strItemCode, , ,

xlWhole)

The address i have from which I want the search to begin

is a result
of a previous search. specifically it is c.address (the

same c that
appears in the code). I didn't succeed to use this

address as the
after parameter for the next find. How can i use this

address? I am
sure I am doing something wrong but I just don't know

what.

Thanks for the help.
.


Tom Ogilvy

new comer problems
 
dim sAddr as String, c as Range
With ActiveSheet
set c =.Range("b2").EntireColumn.Find(strItemCode, , , xlWhole)
if not c is nothing then
sAddr = c.Address
Do
c.Interior.colorindex = 5
set c = .Range("b2").EntireColumn.FindNext(c)
Until c.Address = sAddr
End if
End with
--
Regards,
Tom Ogilvy

"Eitan" wrote in message
om...
Hi,

I am new to the Excell environment. I am trying to use the find method
from a visual basic program and i want to start the search after a
given cell. The code is something like this


Set c = .Range("b2").EntireColumn.Find(strItemCode, , , xlWhole)

The address i have from which I want the search to begin is a result
of a previous search. specifically it is c.address (the same c that
appears in the code). I didn't succeed to use this address as the
after parameter for the next find. How can i use this address? I am
sure I am doing something wrong but I just don't know what.

Thanks for the help.





All times are GMT +1. The time now is 06:04 PM.

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