Excel VBA Macro: copy range -


dim lastrow long  lastrow = sheets("sheet1").cells(sheets("sheet1").rows.count, "a").end(xlup).row  sheets("sheet1").range("a" & lastrow + 1).formular1c1 = "=workday(r[-1]c,1)"  lastrow2 = sheets("sheet1").cells(sheets("sheet1").rows.count, "a").end(xlup).row   'copy cells  sheets("sheet1").range(??????).copy  'destination  sheets("sheet1").range("g" & lastrow2 - 3).pastespecial xlpastevalues end sub 

guys have problem on copying range lastrow lastrow 2. range (lastrow -3 on "g" column until lastrow on "o" column). expected result on range (lastrow2 -3 column "g" until lastrow2 on column "o"). other information, range not filled. there blank space on range. means range want copy. don't know how should set range. please me. have excel don't allowed attach image because have no reputation yet.

enter image description here

in picture have column f circled, in question mention g. went g here. assuming lastrow value correct, doesn't make sense given picture, assumption. assuming lastrow tells row bottom row of copy range.

with sheets("sheet1")     dim rcopy range     set rcopy = .range(.cells(lastrow -2, "g"), .cells(lastrow, "o"))     rcopy.select     rcopy.copy  end 

however, not clear on trying , not use copy , paste if possible.

edit2: have change paste line uses -2 instead of -3.


Comments