ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find text in specific cell?? (https://www.excelbanter.com/excel-programming/369586-find-text-specific-cell.html)

Dewey

Find text in specific cell??
 
Hi,

I'm trying to write some code to determine if a specific cell contains
some text and if the booleen statement is true run the function.

I see the psuedo code something like below but are unsure of the
syntax. The Cell(4,9) actually contains the text "The Street is ..."

if Cell(4, 9) Contains "Street" then

'execute functions'

End if

Thanks

Dewey


Jim Jackson

Find text in specific cell??
 
Give this a try.

If InStr(cell.Offset(0, -8), "Street") Then
'or using your example
If Instr(Cell(4,9), "Street") Then
'execute functions

--
Best wishes,

Jim


"Dewey" wrote:

Hi,

I'm trying to write some code to determine if a specific cell contains
some text and if the booleen statement is true run the function.

I see the psuedo code something like below but are unsure of the
syntax. The Cell(4,9) actually contains the text "The Street is ..."

if Cell(4, 9) Contains "Street" then

'execute functions'

End if

Thanks

Dewey



Dewey

Find text in specific cell??
 
Thanks Jim, worked perfectly!

Jim Jackson wrote:

Give this a try.

If InStr(cell.Offset(0, -8), "Street") Then
'or using your example
If Instr(Cell(4,9), "Street") Then
'execute functions

--
Best wishes,

Jim


"Dewey" wrote:

Hi,

I'm trying to write some code to determine if a specific cell contains
some text and if the booleen statement is true run the function.

I see the psuedo code something like below but are unsure of the
syntax. The Cell(4,9) actually contains the text "The Street is ..."

if Cell(4, 9) Contains "Street" then

'execute functions'

End if

Thanks

Dewey




Jim Jackson

Find text in specific cell??
 
Glad to help.
--
Best wishes,

Jim


"Dewey" wrote:

Thanks Jim, worked perfectly!

Jim Jackson wrote:

Give this a try.

If InStr(cell.Offset(0, -8), "Street") Then
'or using your example
If Instr(Cell(4,9), "Street") Then
'execute functions

--
Best wishes,

Jim


"Dewey" wrote:

Hi,

I'm trying to write some code to determine if a specific cell contains
some text and if the booleen statement is true run the function.

I see the psuedo code something like below but are unsure of the
syntax. The Cell(4,9) actually contains the text "The Street is ..."

if Cell(4, 9) Contains "Street" then

'execute functions'

End if

Thanks

Dewey






All times are GMT +1. The time now is 06:24 AM.

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