vba - Copy last two columns and insert to the left of them -


i having trouble being able copy last 2 columns data in worksheet , insert same columns left of them. here code far, copies correct columns pastes them right.

sub globalperformnewmonths()  dim lnglastrow     long  thisworkbook.worksheets("global supplier performance")      lnglastrow = .range("a" & .rows.count).end(xlup).row      .cells(1, .columns.count).end(xltoleft).offset(,resize(lnglastrow,copy .cells(1, .columns.count).end(xltoleft).offset(, -2)      columns("d:az").columnwidth = 18.43      application.cutcopymode = false end end sub 

try selecting entire columns of data want. select them , insert them left of desired column.

range("d:e").select selection.copy columns("c:c").select selection.insert shift:=xltoright 

Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -