i recorded macro this, , copied macro code , adapted how needed it. however, issue source formatting not kept when paste on new worksheet. step did miss? must selection.pastespecial right? below non-working syntax selection.autofilter activesheet.listobjects("db1.accdb").range.autofilter field:=1, criteria1:="pink" lastrow = 2 worksheets("sheet2").range("a65536").end(xlup).row next lastrow range("a1", "m" & lastrow).copy sheets.add after:=activesheet selection.pastespecial paste:=xlpasteallusingsourcetheme, operation:=xlnone, skipblanks:=false, transpose:=false range("a1").select activesheet.name = "pink" no need selection.pastespecial , normal copy method sufficient. sub copytest() '/ source destination '-------- ----------- sheet1.usedrange.copy sheet2.cells(1, 1) application.cutcopymode = false end sub << --this work c...
Comments
Post a Comment