vba - Repeat macro in excel -
i'm incredibly new vba excel, , ashamed admit don't understand i've read far! i'm trying copy , paste 1 sheet another, , recopying results second sheet first sheet. have 5300 items wish copy - paste original sheet. here's recorded macro resulted:
sub retreive_code() range("l11").select selection.copy windows( _ "unique license plate valuation algorithm.18march2014.v7.0.winner!.xlsx"). _ activate range("d2").select selection.pastespecial paste:=xlpastevalues, operation:=xlnone, skipblanks _ :=false, transpose:=false range("l2").select application.cutcopymode = false selection.copy windows("complete unique number sales.2010 - 2012.xlsx").activate range("m11").select selection.pastespecial paste:=xlpastevalues, operation:=xlnone, skipblanks _ :=false, transpose:=false end sub
please let me know if have questions @ all. many thanks
please avoid use of .select/.activate
interesting read
is trying?
untested
sub retreive_code() dim wb1 workbook, wb2 workbook dim ws1 worksheet, ws2 worksheet '~~> set workbooks here set wb1 = workbooks("unique license plate valuation algorithm.18march2014.v7.0.winner!.xlsx") set wb2 = workbooks("complete unique number sales.2010 - 2012.xlsx") '~~> change these respective sheets set ws1 = wb1.sheets("sheet1") set ws2 = wb2.sheets("sheet1") '~~> copy pasting ws2 ws1.range("d12:d5283").value = .range("l12:l5283").value doevents .range("m12:m5283").value = ws1.range("l12:l5283").value end end sub
Comments
Post a Comment