I'm trying to build code that goes through a series of If
statements to assess the contents of 4 drop down lists in the spreadsheet itself.
However when I use the code below I just get an error saying
Block IF without End IF
which despite trying lots of alternatives can't seem to rid.
Apologies for the length of code here but feel it's necessary to illustrate what I'm trying to accomplish!
Sub GOClick()
Worksheets("Dashboard").Select
If Worksheets("Dashboard").Range("B3") = "National Gallery" And
Worksheets("Dashboard").Range("B4") = "Unframed" And
Worksheets("Dashboard").Range("B7") = "Product Costings" And
Worksheets("Dashboard").Range("B5") = "N/A" And
Worksheets("Dashboard").Range("B6") = "N/A" Then
Worksheets("(7b)").Activate
Range("A8:F23").Copy
Worksheets("Dashboard").Activate
Range("D11").PasteSpecial xlPasteAll
Else:
If Worksheets("Dashboard").Range("B3") = "N/A" And
Worksheets("Dashboard").Range("B4") = "N/A" And
Worksheets("Dashboard").Range("B7") = "Product Costings" And
Worksheets("Dashboard").Range("B5") = "N/A" And
Worksheets("Dashboard").Range("B6") = "Inkjet" Then
Worksheets("(1)").Activate
Range("A5:G69").Copy
Worksheets("Dashboard").Activate
Range("D11").PasteSpecial xlPasteAll
Else:
If Worksheets("Dashboard").Range("B3") = "N/A" And
Worksheets("Dashboard").Range("B4") = "N/A" And
Worksheets("Dashboard").Range("B7") = "Product Costings" And
Worksheets("Dashboard").Range("B5") = "N/A" And
Worksheets("Dashboard").Range("B6") = "Xerox" Then
Worksheets("(1)").Activate
Range("A5:I101").Copy
Worksheets("Dashboard").Activate
Range("D11").PasteSpecial xlPasteAll
Else:
If Worksheets("Dashboard").Range("B3") = "Wholesale" And
Worksheets("Dashboard").Range("B4") = "Ready to Hang" And
Worksheets("Dashboard").Range("B7") = "Product Costings" And
Worksheets("Dashboard").Range("B5") = "N/A" And
Worksheets("Dashboard").Range("B6") = "N/A" Then
Worksheets("(3a)").Activate
Range("A5:S105").Copy
Worksheets("Dashboard").Activate
Range("D11").PasteSpecial xlPasteAll
Else: MsgBox ("No Data")
End If
End Sub