0

I've got values inside an array and I would like to delete the values with are double entries, e.g. I have EUR,EUR,EUR,GBP,YEN and I like to remove the double euro entries within removing them from the execel spreadsheet.

Just save then in an array. The new array should look like that: EUR,GBP,YEN

After that I would like to write them to another spreadsheet.

My code so far:

Dim ArrayCurrency As Variant
RangeStart = "E2"
RangeEnd = "E"
RangeNew = RangeStart & ":" & RangeEnd & lRow
CurrencyArray = Range(RangeNew).Value

For Each element In CurrencyArray

Next element

I hope that you can help me!

Best regards Matthias

user24555
  • 39
  • 1
  • 1
  • 8

1 Answers1

0

Use Dictionary object for unique values - in the future.

For your current case, you may use RemoveDuplicates method on the range.

bonCodigo
  • 14,268
  • 1
  • 48
  • 91
  • thank you for your answer! But I don't know how I can use a dictionary whitin vba? could you give an example? – user24555 Jun 30 '15 at 09:46
  • As said that's for future. But did you try the answers tag in the above comment? Those include dictionary object. – bonCodigo Jun 30 '15 at 15:08