You are here:

Excel/Excel drop down + if statement


I'm trying to create an invoicing document in excel. It is completed for the most part, however I am having trouble with a formula. I'm trying to make a series of cells (running vertical) look up the contents of a cell. Then depending on the content of that cell I need it to create a drop down box from one of two ranges. Something like -   

If C6 = Example1 display range A1:A6 as a drop down
If C6 = Example2 display range B1:B6 as a drop down

Thanks in advance.

Hi Keith
How are you?

I know it is not yet the proper solution, but can you run the following VBa code?

1. Draw a combobox in sheet 1
2. Run the VBA Editor
3. Insert a module
4. Paste into this module

Sub Macro1()
Dim R As Range
Set R = Sheets(1).Range("C6")
Set Cb = Sheets(1).DropDowns.Add(313, 133.5, 130, 40)
If R.Cells(1, 1) = "Example1" Then
  Cb.ListFillRange = "$A$1:$A$6"
  Cb.ListFillRange = "$B$1:$B$6"
End If
End Sub
5. Assign this macro to a button.

I Hope you try to run this macro.

About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Adelaide carvalho


I will be able to answer any question on Excel and Visual Basic for Applications - class modules, recursive procedures and functions are my favourite


Past/Present Clients
Several readers of my Books think they are useful.

©2017 All rights reserved.