Hi
I have a small problem with a script, as I recorded use to work but not anymore as I want it to.
I have a sheet with data, rows from 2 to many over time. Each rows has a Kategory and I want to copy all these rows to a news sheet, but I want them to be sortet in som kind of header.
If you look at my workbook, I want data from sheet1 to be placed in sheet"Backup" but sortet and and only listed ones below the header of the category each item have. I have tried the below code without any luck now.
Also the code are under the 3 button on the first sheet and I hope someone could assist me?
Sheets("Sheet2").Select
UsedRange.Clear
With [Sheet1!A1].CurrentRegion.Rows
.Columns(7).AdvancedFilter 2, , .Range("K1"), True
V = .Range("K1").CurrentRegion.Value2
For L = 2 To UBound(V)
.Range("K2").Value2 = V(L, 1)
.AdvancedFilter 1, .Range("K1:K2")
.Item("2:" & .Count).Columns("A:D").Copy Cells(R + 2, 1)
With Cells(R + 1, 2)
.Font.Bold = True
.HorizontalAlignment = xlCenter
.Value2 = V(L, 1)
R = .End(xlDown)(2).Row
End With
Next
.Parent.ShowAllData
.Range("K1").CurrentRegion.Clear
End With
Bookmarks