Consulting

Results 1 to 4 of 4

Thread: Pasting Special Cell into different sheet

  1. #1

    Pasting Special Cell into different sheet

    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...
    Thanks
    Sankar

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Maybe insert will do what you need:
    [VBA]
    Option Explicit
    Sub Macro1()
    Dim Rng1 As Range, Rng2 As Range
    Set Rng1 = ActiveSheet.Range("C58")
    Set Rng2 = Sheets("sheet2").Range("C5")
    Rng1.Copy
    Rng2.Insert
    End Sub
    [/VBA]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3

    Post

    Quote Originally Posted by lucas
    Maybe insert will do what you need:
    [VBA]
    Option Explicit
    Sub Macro1()
    Dim Rng1 As Range, Rng2 As Range
    Set Rng1 = ActiveSheet.Range("C58")
    Set Rng2 = Sheets("sheet2").Range("C5")
    Rng1.Copy
    Rng2.Insert
    End Sub
    [/VBA]
    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.
    Thanks
    Sankar

  4. #4
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    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.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •