Solved

tricky copy and special paste data

Posted on 2014-01-13
7
280 Views
Last Modified: 2014-01-13
Hi Expert's excel 2007

I need a macro that will copy data from worksheet pivot...based on the data in column a I.e copy all the data above the txt Grand Total and paste into new workbook and save workbook to file path \\gpobal.yftuu\hfghj\ da
te & .xlsx file...

starting range is always A6:hx where is depend on column a and one less grand total txt..
0
Comment
Question by:route217
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 33

Expert Comment

by:Rob Henson
ID: 39776398
Is there anything else on the Pivot sheet?

If not you can just do a Worksheet Copy and then break the links or copy and paste all with values.

If that is what you want, let us know and I will sort the macro for you.

Thanks
Rob
0
 

Author Comment

by:route217
ID: 39776411
Nothing else in pivot....

I do not trust the end users...I would kindly like the macro please
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 39776415
OK, couple of questions then:

1) Name of sheet containing Pivot
2) Path & Filename required for Saved file
3) Do you want to get rid of Rows 1 to 5 above copied pivot and row containing Grand Total

Thanks
Rob H
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:route217
ID: 39776461
1. Pivot - confirmed
2. \\global.test\heujejek\   ps I can amend...
3. Yes and yes in the new pasted workbook and paste into sheet 1 also re name sheet 1 as confirmed numbers and delete sheets 2 and 3.
0
 
LVL 33

Accepted Solution

by:
Rob Henson earned 500 total points
ID: 39776511
Here's something to get you started, let me know if need any changes.

Sub CopySheet()
    
    Sheets("Pivot").Select
    Sheets("Pivot").Copy
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Application.CutCopyMode = False
    Rows("1:5").Select
    Selection.Delete Shift:=xlUp
    Range("A1").Select
    Cells.Find(What:="Grand Total", After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate
    Selection.EntireRow.Delete
    Sheets("Pivot").Select
    Sheets("Pivot").Name = "Confirmed"
    FilePath = "\\global.test\heujejek\"
    NewFileName = "Pivot Copy 140113.xlsx"
    ActiveWorkbook.SaveAs Filename:=FilePath & NewFileName, FileFormat:= _
        xlOpenXMLWorkbook, CreateBackup:=False
    ActiveWindow.Close

End Sub

Open in new window

I guess you will need some dynamic way of changing the filename. What naming convention will you need?

Thanks
Rob H
0
 

Author Comment

by:route217
ID: 39776556
Thanks Rob H ...let me test kindly.
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 39776590
Take your time, I will be online until 17:00 GMT.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
converting excel into labels 6 37
Excel shared spreadsheet 12 38
Excel not storing numeric string correctly 5 42
Excel - Active X Checkboxes Groups 45 36
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question