vba - Excel 2010 - Macro Copy range of cells instead of entire row -
i've tried using feedback similar threats - can't seem implement of them in code. apoligize i'm brand new macros!
i have spreadsheet pivot table, wish copy a2:j2 if k2="create". macro working copying entire row, can please me?
sub create() dim rngcolf range dim range dim dest range sheets("data").select set rngcolf = range("k1", range("k" & rows.count).end(xlup)) sheets("open quotes") set dest = .range("a" & rows.count).end(xlup).offset(1, 0) end each in rngcolf if i.value = "create" i.entirerow.copy dest set dest = dest.offset(1) sheets("open quotes").select end if next end sub
try
sub create() dim rngcolf range dim range dim dest range sheets("data").select set rngcolf = range("k1", range("k" & rows.count).end(xlup)) sheets("open quotes") set dest = .range("a" & rows.count).end(xlup).offset(1, 0) end each in rngcolf if i.value = "create" range(cells(i.row,1).address,cells(i.row,10).address).copy dest set dest = dest.offset(1,0) sheets("open quotes").select end if next end sub
i not sure data want copy. if in data sheet have problem selecting "open quotes" second time runs around copy "open quotes". may want address that.
edit: sake of being complete sheets("open quotes").select should (and believe op has) moved end of code
Comments
Post a Comment