AND Condition

sevenfive85

New Member
Joined
Jul 21, 2021
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Can someone please help with this conditional statement? I need two things to be true for the word "Select" to appear, Cell D3 must be "Yes" and C8 must contain something. Code below is what I have but it is wrong, please help. Thank you.


If Target.Address = "$D$3" Then
If Target.Value = "Yes" And Range("C8").Value <> "" Then
Range("K8:K300").Value = "Select"
Else
Range("K8:K300").Value = ""
End If
End If

1628109684755.png
 
Hi guys just one more question. I need to change the code to look for a specific character but it is giving me an error. The red highlighted is what it was and work fine but I need to change it to the yellow code to look for "#" in column C. Thank you

1628611835985.png
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
You have to replace Search with Instr.
But your comparison will never return true.
Try:
VBA Code:
if left(inarr(i,1),1)="#" then
 
Upvote 0

Forum statistics

Threads
1,215,005
Messages
6,122,661
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top