Excelllllllllllllllllllll
Board Regular
- Joined
- Jun 13, 2017
- Messages
- 108
Hi, I've got this code that I need to make into one line or function (because of how many of the bastard I have excel won't run my macro).
I need the If functions in bold to be as though there's an OR between them.
So it's
Thank you to everyone who will try to help me!
I've already learned so much from people on this forum, you guys are amazing.
Code:
If Range("C15").Value > 1 And Range("C15").Value <= 18 Then
If (Range("D6").Value = "X" Or Range("D6").Value = "Y" Or Range("D6").Value = "Z") Then
[B]If[/B] Range("C15").Value = Worksheets("Sheet2").Range("K1").Value And Worksheets("Sheet2").Range("L1").Value = "" Then
If (Worksheets("Sheet2").Range("k1").Value <> Range("C21").Value Or Worksheets("Sheet2").Range("k1").Value <> Range("C27").Value Or Worksheets("Sheet2").Range("k1").Value <> Range("C33").Value Or Worksheets("Sheet2").Range("k1").Value <> Range("C39").Value Or Worksheets("Sheet2").Range("k1").Value <> Range("C45").Value) Then
Call K1_2
Call Remove_List
[B] If [/B]Range("C15").Value = Worksheets("Sheet2").Range("K2").Value And Worksheets("Sheet2").Range("L2").Value = "" Then
If (Worksheets("Sheet2").Range("k2").Value <> Range("C21").Value Or Worksheets("Sheet2").Range("k2").Value <> Range("C27").Value Or Worksheets("Sheet2").Range("k2").Value <> Range("C33").Value Or Worksheets("Sheet2").Range("k2").Value <> Range("C39").Value Or Worksheets("Sheet2").Range("k1").Value <> Range("C45").Value) Then
Call K2_2
Call Remove_List
...etc K3, K4, K5, K6
End If
I need the If functions in bold to be as though there's an OR between them.
So it's
Code:
If Range("C15").Value > 1 And Range("C15").Value <= 18 Then
If (Range("D6").Value = "X" Or Range("D6").Value = "Y" Or Range("D6").Value = "Z") Then
If1 ... condition ... then ... call macro 1
or
If2 ... condition ... then ... call macro 2
or
If3 ... condition ... then ... call macro 3
...etc
Thank you to everyone who will try to help me!
I've already learned so much from people on this forum, you guys are amazing.