neodjandre
Well-known Member
- Joined
- Nov 29, 2006
- Messages
- 950
- Office Version
- 2019
- Platform
- Windows
I have this code to filter a table and paste the used range to another sheet. However, I only want the values to be pasted and nothing else.
My code incorrectly copies the format and conditional formatting. any ideas why ? many thanks!
My code incorrectly copies the format and conditional formatting. any ideas why ? many thanks!
Code:
Set lo_b1 = x_bf1.ListObjects("Feed1")
s_date = CLng(ThisWorkbook.Names("drd_sta").RefersToRange(1, 1))
e_date = CLng(ThisWorkbook.Names("drd_end").RefersToRange(1, 1))
s_des = ThisWorkbook.Names("dr_no").RefersToRange(1, 1)
s_code = ThisWorkbook.Names("dr_co").RefersToRange(1, 1)
s_type = ThisWorkbook.Names("dr_le").RefersToRange(1, 1)
With lo_b1.Range
.AutoFilter Field:=13, Criteria1:=s_code
.AutoFilter Field:=1, Criteria1:=">=" & s_date, Operator:=xlAnd, Criteria2:="<=" & e_date
End With
lastrow_s = lo_b1.Range.Columns(1).Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Set strng = ThisWorkbook.Names("co_st").RefersToRange
Set copyrng = x_bf1.Range("D8:X" & lastrow_s)
copyrng.SpecialCells(xlCellTypeVisible).Copy
strng.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone
Last edited: