On 4 sep, 17:29, Dave Peterson <peter...@verizonXSPAM.net> wrote:
> I'm not sure I understand.
>
> But if you meant that you're not going to add headers and instead just delete
> that first row (which would have been treated like a header), you may want to be
> careful.
>
> If that's the only entry that appears in the original list, you'd be deleting
> one of the unique values.
>
> I'd either add the headers first, do the advanced filter, then delete the
> headers.
>
> Or check to see if that "header" appears in the list further down before
> deleting it.
>
> Jumparound wrote:
>
> <<snipped>>
>
>
>
> > i figured i could delete the first entry right after copying, so i
> > made a makro to delete fhe first row aftert his one 
> > but ill try to use your answers too!
>
> --
>
> Dave Peterson
Oke, this is what happends...
information get exported to excel
My macro kicks in.
I copy unique values from Sheet1.B:B to Sheet2.A2 (this includes the
header.)
Then i delete first row (Sheet2.A2 -> the header from Sheet1.B1)
Then i clear empty spaces
Then i sort on name
"rest of the code executes"
This i a working way, have tested it on several documents.
Now im ready to try something else.
Code:
Sub CopyUniqueEntries()
Dim LastRow As Long
LastRow = Cells(Rows.Count, "B").End(xlUp).Row 'last data cell in col
B
Range("B2:B" & LastRow).AdvancedFilter Action:=xlFilterCopy,
CopyToRange:=Range( _
"A2"), Unique:=True
Range("A2").Delete 'removes unwanted header
End Sub
This look indeed like the code i need to use, now im ready to try it.