ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need help with If/Then Syntax (https://www.excelbanter.com/excel-programming/363318-need-help-if-then-syntax.html)

Shani

Need help with If/Then Syntax
 
I want more than one actions to be carried out for and if statement.

So for example

If Cells(i,,j) "*Like*" Cells(i,k) Then t=g and m=3 and var=6


The above statement dosnt work. can you please help me witht he syntax


Heather Heritage

Need help with If/Then Syntax
 
I think you want to search for the contents of one cell in the other, so

if instr(cells(i,j),cells(i,k))0 then....
"Shani" wrote in message
oups.com...
I want more than one actions to be carried out for and if statement.

So for example

If Cells(i,,j) "*Like*" Cells(i,k) Then t=g and m=3 and var=6


The above statement dosnt work. can you please help me witht he syntax




Shani

Need help with If/Then Syntax
 
The code up til "If Cells(i,,j) "*Like*" Cells(i,k) Then t=g" works
great i want more than one statement for the Then. What is the proper
syntax?


Heather Heritage wrote:
I think you want to search for the contents of one cell in the other, so

if instr(cells(i,j),cells(i,k))0 then....
"Shani" wrote in message
oups.com...
I want more than one actions to be carried out for and if statement.

So for example

If Cells(i,,j) "*Like*" Cells(i,k) Then t=g and m=3 and var=6


The above statement dosnt work. can you please help me witht he syntax



Bob Phillips

Need help with If/Then Syntax
 
If Cells(i,,j) Like "*" &Cells(i,k) & "*" Then
t=g
m=3
var=6
End If


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Shani" wrote in message
oups.com...
I want more than one actions to be carried out for and if statement.

So for example

If Cells(i,,j) "*Like*" Cells(i,k) Then t=g and m=3 and var=6


The above statement dosnt work. can you please help me witht he syntax





All times are GMT +1. The time now is 08:52 AM.

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