I'm using Excel 2007. I'm trying to reacreate the pattern shown in the sequence column. Could someone please give me a pointer as to how I could do this?
Excel version is 2007. I know there are later versions of Excel which harness the UNIQUE Function. I was trying to use something similar with this VBA function in a module. Calling it within the formula but ran into problems and figured there may be a much easier way.
Function UNIQUE(rng As Range) As Variant()
Dim list As New Collection
Dim Ulist() As Variant
'Adding each value of rng to the collection.
On Error Resume Next
For Each Value In rng
'here value and key are the same. The collection does not allow duplicate keys hence only unique values will remain.
list.Add CStr(Value), CStr(Value)
Next
On Error GoTo 0
'Defining the length of the array to the number of unique values. Since the array starts from 0, we subtract 1.
ReDim Ulist(list.Count - 1, 0)
'Adding unique value to the array.
For i = 0 To list.Count - 1
Ulist(i, 0) = list(i + 1)
Next
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.