Drop Down List value is empty in vba

WarPigl3t

Well-known Member
Joined
May 25, 2014
Messages
1,611
A
1yes
2no

<tbody>
</tbody>
Hello. A1 says "yes". It is a drop down list. So is A2. The values yes and no are in another worksheet. The table above is drop down list values. So now I have some vba code that I want to check what the value is.

lets say that in cell B1 I put this formula in:
= myFunction()
Code:
Function myFunction()[INDENT][COLOR=#ff0000]test = Range("A1").value[/COLOR]
[/INDENT]
[INDENT]myFunction = test
[/INDENT]
End Function
I used F8 on my keyboard to run the code line by line. When it reaches test = Range("A1").value, it says that it is Empty. It is obviously not empty. The word "yes" I selected from a drop down list and I assume that it doesn't consider that a value. Does anyone know a work-around? It does need to be a function, not a sub.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,214,846
Messages
6,121,905
Members
449,054
Latest member
luca142

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