Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

tricky copy and special paste data

Posted on 2014-01-13
7
Medium Priority
?
293 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
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 will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

715 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