ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Finding and storing (https://www.excelbanter.com/excel-programming/367953-finding-storing.html)

T De Villiers[_36_]

Finding and storing
 

Hi,

I need to find the text "Shell" within a worksheet and then store the
column number within a variable i, then need to find text "Chevron"
and then store the column number within a variable j.

below is the start of my code, many thanks

Cells.find(What:="Shell", After:=ActiveCell, LookIn:=xlFormulas, LookAt
_
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate

i = ...........


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=563699


Don Guillett

Finding and storing
 
Sub findcolumn()
i = Cells.Find("shell").Column
MsgBox i
End Sub

--
Don Guillett
SalesAid Software

"T De Villiers"
wrote in message
news:T.De.Villiers.2bat1s_1153490318.2011@excelfor um-nospam.com...

Hi,

I need to find the text "Shell" within a worksheet and then store the
column number within a variable i, then need to find text "Chevron"
and then store the column number within a variable j.

below is the start of my code, many thanks

Cells.find(What:="Shell", After:=ActiveCell, LookIn:=xlFormulas, LookAt
_
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate

i = ...........


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile:
http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=563699





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

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