Paste range without conditional formatting doesn't work
Results 1 to 1 of 1

Thread: Paste range without conditional formatting doesn't work
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Nov 2006
    Posts
    917
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Paste range without conditional formatting doesn't work

    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!

    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 by neodjandre; May 28th, 2019 at 01:10 PM.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •