excel - PasteSpecial method on range fails -
i'm trying paste range of cells in worksheet. have come far:
for = 1 mycount wbk.activate set criteria = sheets(igmsheet).cells(i, 1) sheets(igmsheet).range(cells(i, 2), cells(i, 4)).copy 'this copies 3 cells need w.activate if activesheet.autofiltermode activesheet.showalldata 'remove autofilter selection.autofilter range("$a$1:$bm$204").autofilter field:=2, criteria1:=criteria.value range("$bc$1:$be$204").specialcells(xlcelltypevisible).pastespecial next
if update value in range works, pasting cells not.
kindly advice.
further comment above, try this...
dim rng range = 1 mycount wbk.activate set criteria = sheets(igmsheet).cells(i, 1) set rng = sheets(igmsheet).range(cells(i, 2), cells(i, 4)) w.activate if activesheet.autofiltermode activesheet.showalldata 'remove autofilter selection.autofilter range("$a$1:$bm$204").autofilter field:=2, criteria1:=criteria.value rng.copy range("$bc$1:$be$204").specialcells(xlcelltypevisible).pastespecial next
there few other things noticed. example using .activate
, unqualified cells range(cells(i, 2), cells(i, 4))
you might want see this
Comments
Post a Comment