VBA DropDown search

GeorgesT

New Member
Joined
Mar 20, 2013
Messages
7
Hello MVP's and other VBA pro's,

I have a problem in VBA.
I want to do a look up in a column containing dropdowns in a range (E:17, G59).
The drop down has two options, 1 is containing only blanks (from a hidden sheet, linked to the input of column A) the other is containing any text value (from the same hidden sheet).
If the dropdown contains only blanks it should do nothing. If it contains any text value, it should highlight red.

Is there a way I can apply this event in the worksheet?

Kind regards
Georges
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
I came up with this event, but it gives an error "Unable to get the specialcellsproperty of the range class"



Private Sub Worksheet_Change(ByVal Target As Range)

For Each x In Columns(5).SpecialCells(xlCellTypeAllFormatConditions, xlDropDown)
If x.Value = True Then
Cells(k, 5).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark2
.TintAndShade = -0.749992370372631
.PatternTintAndShade = 0
End With
MsgBox "ok"
End If
Next x
On Error Resume Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,109
Messages
6,128,880
Members
449,477
Latest member
panjongshing

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