98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Multipe OR statements?
Multipe OR statements?
Resolved · Urgent Priority · Version 2003
Angela has attended:
Excel VBA Intro Intermediate course
Multipe OR statements?
Hi
I'm creating a user form and i want when the user click a button it will show a list of items that they have selected from a previous sheet with boxes.
So How do I write a code for multiple 'OR' staments
for example I want to say if
Cell A2 = true then dsiplay contents of cell E2, if Cell A3 is true then display contents of E3 etc...
At the end they should have a list of items on the user form.
I can get one item to show with this code
Private Sub cmdAdd_Click()
Set ws = Worksheets("Exchange Input")
ws.Visible = True
If Range("A2").Value = True Then
Me.txtExchanges.Value = Range("E2")
End If
End sub
If I add multiple if statements, if all the cells are true only one item is listed on the form.
RE: multipe OR statements?
Hi Angela
Thank you for your question
It is difficult to advise without seeing your spreadsheet directly.
My first thought however is that ratherthan using an OR statement, a better approach might be a SELECT CASE structure.
I suggest you try this.
If this doesnt work perhaps you could email me the spreadsheet in question and I will look into it
Regards
Stephen
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Create a unique items table from a duplicating table1. Ensure that your list has column headings |