+ Reply to Thread
Results 1 to 1 of 1

Code NOT working properly - Copy/Paste Multiple Tables

Hybrid View

Blackhawks Code NOT working properly -... 08-14-2014, 12:18 PM
  1. #1
    Forum Contributor
    Join Date
    05-29-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    143

    Code NOT working properly - Copy/Paste Multiple Tables

    Hello all,

    I'm trying to copy multiple PivotTables from different worksheets and place one in cell A5 and one in D5... I know my code for the placement portion is not correct, but I don't see why my code for the Copy isn't right.

    Any help is greatly appreciated!

    Private Sub Worksheet_Change(ByVal Target As Range)
    
         If Not Application.Intersect(Target, Sheets("PivotTest1").Range("C2")) Is Nothing Then
            Application.EnableEvents = False
            If StrComp(Target, "Revenue", vbTextCompare) = 0 Then
                Sheets("Revenue").PivotTables("PivotTable3").TableRange2.Copy
                Sheets("Revenue").PivotTables("PivotTable5").TableRange2.Copy
            Else
                Sheets("GOP").PivotTables("PivotTable4").TableRange2.Copy
                Sheets("GOP").PivotTables("PivotTable6").TableRange2.Copy
            End If
            With Range("A5,D5")
                .PasteSpecial Paste:=xlPasteValuesAndNumberFormats, _
                              Operation:=xlNone, SkipBlanks:=False, Transpose:=False
                .PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
                              SkipBlanks:=False, Transpose:=False
            End With
            Target.Select
            Application.EnableEvents = True
         End If
    
    End Sub
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Code to copy and paste not working
    By missit in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-13-2014, 10:27 PM
  2. VBA Code for a Button (Copy, Paste) not working. Help Please
    By pelle3988 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-12-2013, 04:45 PM
  3. [SOLVED] Copy & Paste Code not working second time around?
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-10-2013, 05:08 PM
  4. VBA Copy Paste Code not Working...
    By geng in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2010, 10:30 PM
  5. Code not working exactly, copy and paste issue
    By jpthelpguy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-22-2009, 01:42 PM

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