TonyJamesTroiano
New Member
- Joined
- Dec 2, 2015
- Messages
- 14
I'm trying to create a set of VBA modules to auto format some raw data for a regular review.
My first big hurdle is to extract the unique combinations of Customer Name, vehicle type, and Sleeper Code for the vehicles the customer currently has leased from us.
I am successfully getting a single column of unique values from this code and can bounce the pointer to any of the 3 identifier columns.
My first big hurdle is to extract the unique combinations of Customer Name, vehicle type, and Sleeper Code for the vehicles the customer currently has leased from us.
Code:
Sub UniqueCustomerVehiclesList()
Dim X
Dim objDict As Object
Dim lngRow As Long
Sheets("MYFleetProfile").Select
Set objDict = CreateObject("Scripting.Dictionary")
X = Application.Transpose(Range([A1:A1], Cells(Rows.Count, "A").End(xlUp)))
For lngRow = 1 To UBound(X, 1)
objDict(X(lngRow)) = 1
Next
Sheets("BuildReport").Select
Range("A1:A" & objDict.Count) = Application.Transpose(objDict.keys)
Columns("A:A").Select
I am successfully getting a single column of unique values from this code and can bounce the pointer to any of the 3 identifier columns.
Last edited: