PDA

View Full Version : Pasting Special Cell into different sheet



sankartalam
01-24-2009, 08:25 AM
Can anyone please let me know the solution for my below

I have some range of data in one Excel which contains some formulas,color cells,different border and some text data and also number data, I want this to be copied into different sheet into some particualr range.


please let me know the way or sample code anything would be greatly appreciated...

lucas
01-24-2009, 09:36 AM
Maybe insert will do what you need:

Option Explicit
Sub Macro1()
Dim Rng1 As Range, Rng2 As Range
Set Rng1 = ActiveSheet.Range("C5:D8")
Set Rng2 = Sheets("sheet2").Range("C5")
Rng1.Copy
Rng2.Insert
End Sub

sankartalam
01-24-2009, 10:18 AM
Maybe insert will do what you need:

Option Explicit
Sub Macro1()
Dim Rng1 As Range, Rng2 As Range
Set Rng1 = ActiveSheet.Range("C5:D8")
Set Rng2 = Sheets("sheet2").Range("C5")
Rng1.Copy
Rng2.Insert
End Sub


Thank you very much fro the reply Lucas...

But the thing here is i will copy multiple ranges from the old one and will paste those ranges in particular ranges in the new sheet.

I tried PasteSpecialCells(xlPasteAll) but its pasting the ranges as images in the new sheet, But I dnt need that type of paste as i will have to perform some operations on the newly copied range of cells.

I tried the Insert too But its not working fine for all my ranges only some of the ranges got pasted and some are replaced with the previous copied range.
suppose if i have 2 ranges Rng1 and Rng2 in the old
while pasting Rng1 only Insert twice in the new sheet insteat Rng2.

Could you please let me know different mechanism(if any), So that will proceed with that.... Meanwhile will try to solve with my ideas.

lucas
01-24-2009, 12:02 PM
I tried the Insert too But its not working fine for all my ranges only some of the ranges got pasted and some are replaced with the previous copied range.
suppose if i have 2 ranges Rng1 and Rng2 in the old
while pasting Rng1 only Insert twice in the new sheet insteat Rng2.

You will have to seperate the copy and inserts in the way that is logical.

You will have to give us an example of what you are trying to do. Post a workbook with before and after and notes as to what you are trying to do.