Hi, I found this code in this forum.
It selects data based on the filtered rows of data and then it pastes it in another sheet based under the name of the filtered data that was selected. I need to only copy the values though because some of the areas are highlighted with different colors and formats and I want them to remain the same. I am not very good at this but I have tried everything and I can't seem to make just simple code like "ActiveSheet.PasteSpecial xlValues" work or else I am putting it in the wrong place.
Dim NewRow As Integer
NewRow = Worksheets("LISTS").Range("Z3").Value + 1
Dim strsearch As String, lastline As Integer, tocopy As Integer
'strsearch = CStr(InputBox("enter the string to search for"))
strsearch = CStr(UserForm2.CatName.Value)
lastline = Range("L65536").End(xlUp).Row
'NewRow = 1
For i = 1 To lastline
For Each c In Range("B" & i & ":Z" & i)
If c.Text = strsearch Then
tocopy = 1
If tocopy = 1 Then