ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Non-unique elements in an array (https://www.excelbanter.com/excel-discussion-misc-queries/41557-non-unique-elements-array.html)

Andrew

Non-unique elements in an array
 
In a macro I'm writing I need to find out if a new value I'm adding to an
array already exists as a value within that array. Can anyone help, please?

Thanks,

Andrew

KL

Hi Andrew,

Try something like this:

If IsError(Application.Match(myValue, myArray, 0)) Then
'...
Else
'...
End If

Regards,
KL


"Andrew" wrote in message
...
In a macro I'm writing I need to find out if a new value I'm adding to an
array already exists as a value within that array. Can anyone help,
please?

Thanks,

Andrew





All times are GMT +1. The time now is 02:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com