Hi All
Not really a great VBA coder as you will be able to tell.
I have a user form with some selection criteria, when a partiular status is selected I pricess my range of data and set the non wanted rows to be a null value and write this data back into the range.
How do I then remove the blank lines from my temp worksheet, I was trying to use a filter but this wasnt working.
Any ideas?
'PROJECT STATUS SELECTION
'Data range
Set rngdata = Range("AB2", Range("AB" & Rows.Count).End(xlUp))
'Read data into an Array
v = rngdata.Value
'add the selected ListBox items to a Dictionary object
Set Dict = CreateObject("Scripting.Dictionary")
Dict.CompareMode = 1 'Text compare mode
With ProjStatus
For f = 0 To ProjStatus.ListCount - 1
If .Selected(f) Then
Dict(.List(f)) = f
End If
Next f
End With
'Test each item in the data array if it exists in the Selected items Dictionary
For f = LBound(v) To UBound(v)
'Items that that are not selected are cleared (vbNullstring) from the data array
If Not Dict.Exists(v(f, 1)) Then v(f, 1) = vbNullString
Next f
'Write the data array back to the data range
rngdata = v
NOW I HAVE THE AMENDED RANGE I WANT TO REMOVE THE NULL VALUED ROWS FROM MY SHEET BY DELETING THEM
Cheers
Sean
Bookmarks