not copying some except range cells

Microsoft Office excel 2007 home & stude...
July 10, 2010 at 11:48:14
Specs: Windows XP, 2GB
i want to copy sheet 1's (c6 to c1000 and g6 to g1000)
column except (c265:c300 and g265:g300) to sheet 2's
c6 to c1000 and g6 to g1000 though vba coding. please
help

See More: not copying some except range cells

Report •

#1
July 10, 2010 at 17:48:38
Copying a range that does not include all of Sheet1!C6:C1000 is not going to fill up Sheet2!C6:C1000. (Same for G6:G1000)

Assuming that you want C301 to be pasted into C301, try this code in a backup copy of your workbook.

Macros can not be easily undone.

Sub CopyPartialRanges()
Sheets(1).Range("C6:C264").Copy _
 Destination:=Sheets(2).Range("C6")
Sheets(1).Range("C301:C1000").Copy _
 Destination:=Sheets(2).Range("C301")
Sheets(1).Range("G6:G264").Copy _
 Destination:=Sheets(2).Range("G6")
Sheets(1).Range("G301:G1000").Copy _
 Destination:=Sheets(2).Range("G301")
End Sub


Report •

#2
July 11, 2010 at 11:05:01
Thank you very much. it works for me.

Report •
Related Solutions


Ask Question