VBA cpy & Paste

  • Thread starter Thread starter uziel_9
  • Start date Start date
U

uziel_9

Hi all,

Can I, using VBA, copy range A1:G1 and paste only the content of
the first three cells (A1:C1) to, let's say, A2:C2?

Thanx for your help,
Uziel
 
No, but you could just copy A1:C1 to start.

Hi all,

Can I, using VBA, copy range A1:G1 and paste only the content of
the first three cells (A1:C1) to, let's say, A2:C2?

Thanx for your help,
Uziel
 
Thanx Dave,

I'm trying to use an already existing code(First code) that copy A1:G1
and would like
to, in one occasion (Second code): Paste the all 7 cells and in
different occasion (Third code): Paste only 3 cells.

Thanx again for your quick reply,
Uziel
 
I'd go back and copy the smaller range.

(Or paste then clear the other cells--your original values would be lost.)
 
If your code uses variables, you could do something like:


dim rngtocopy as range
dim destcell as range

with worksheets("sheet1")
set rngtocopy= .range("a1:G1")
end with

set destcell = worksheets("sheet2").range("a1")
rngtocopy.copy _
destination:=destcell

rngtocopy.resize(1,3).copy _
destination:=someothercellthatIdon'tknow
 
Back
Top