xlcelltypeAllValidation not working

shazab_rafiq

New Member
Joined
Sep 3, 2013
Messages
2
so a bit of background as to what im trying to acheive here:

I want a peice of code that runs through all cells & finds every cell with a drop down in. Now the below seems to work but on occassions it doesnt show some cells that have validation(drop down) in them:

activesheet.usedrange.SpecialCells(xlCellTypeAllValidation).Address

any idea why the above is not working?

If anyone could suggest a better way of finding all drop down cells using VBA that would be great
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
hi and welcome to the board

try like below

Code:
Sub Test()
ActiveSheet.UsedRange.SpecialCells(xlCellTypeAllValidation).Select
For Each cell In Selection
 n = n & "," & cell.Address
Next
MsgBox "Below Are The Cell Address Which having Validation" & vbCr & vbCr & n
End Sub
 
Upvote 0
hi and welcome to the board

try like below

Code:
Sub Test()
ActiveSheet.UsedRange.SpecialCells(xlCellTypeAllValidation).Select
For Each cell In Selection
 n = n & "," & cell.Address
Next
MsgBox "Below Are The Cell Address Which having Validation" & vbCr & vbCr & n
End Sub

Thank you so much!! worked perfectly. :)
 
Upvote 0

Forum statistics

Threads
1,215,514
Messages
6,125,273
Members
449,220
Latest member
Excel Master

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