+ Reply to Thread
Results 1 to 3 of 3

Paste Special issue with Macro

Hybrid View

pingwin77 Paste Special issue with Macro 04-14-2011, 11:17 AM
Andy Pope Re: Paste Special issue with... 04-14-2011, 11:36 AM
pingwin77 Re: Paste Special issue with... 04-14-2011, 01:39 PM
  1. #1
    Registered User
    Join Date
    10-03-2007
    Location
    Twin Cities, MN
    MS-Off Ver
    2003
    Posts
    83

    Paste Special issue with Macro

    Sub MMC_Hole()
    'Add MMC HOLE to report - 01-07-2009 by Mike Shadick
        
        Sheets("Formulas").Range("B2:K7").Copy
        Sheets("Data30 - Dev").Select
        ActiveCell.Offset(0, 0).Select
        ActiveSheet.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
            True, Transpose:=False
        ActiveCell.Offset(6, 0).Select
    End Sub
    I am trying to use the above code to copy data from one sheet and paste special/skip blanks on a second sheet. I want all the formatting and formulas, but I want to skip the blank cells so it does not replace the data I have already entered. For some reason, I keep getting an error and the debugger highlights the Activesheet.Pastespecial part of the code. What am I doing wrong here?
    Last edited by pingwin77; 04-14-2011 at 03:58 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Paste Special issue with Macro

    try activecell rather than activesheet

        Activecell.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
            True, Transpose:=False
    also check the help on PasteSpecial.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    10-03-2007
    Location
    Twin Cities, MN
    MS-Off Ver
    2003
    Posts
    83

    Re: Paste Special issue with Macro

    So I got the code to skip blanks, the issue I now have is that It only pastes the cells with stuff in them. I have blank cells with formatting (Color, borders) that I need to copy as well. Should I add a separate line of code that pastes formats or can this be done with the same line of code that skips blanks?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1