Read xlDupeUnique enumeration?

Dr. Demento

Well-known Member
Joined
Nov 2, 2010
Messages
618
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Is there a way to read UniqueValues.xlDupeUnique enumeration instead of only declaring/assigning it?

Thanks y'all.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Maybe...

Code:
Dim myVar As Long
myVar = Range("A2:A7").FormatConditions(1).DupeUnique
If myVar = 0 Then
    MsgBox "Unique values"
Else
    MsgBox "Duplicate values"
End If

M.
 
Upvote 0
Thank you, Marcelo. You provided the missing piece: .FormatConditions(1). Additionally, I found that my solution requires that the sheet to be activated that contains the object (the range with the Unique/Duplicate conditional format) and outputs 0 for Unique and 1 for Duplicates.

Code:
sht.Activate  ' ~ Required to allow next line to function properly!!!
obj.AppliesTo.FormatConditions(1).DupeUnique

Thanks again.
 
Upvote 0

Forum statistics

Threads
1,224,765
Messages
6,180,843
Members
453,001
Latest member
coulombevin

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