View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
TroyT TroyT is offline
external usenet poster
 
Posts: 19
Default Need VBA/Macro help in Excel (I think)

The C* corresponds to a Pivot table, and if there is data present, it drills
down, and selects all data. The data is then pasted into the next available
line in the Data sheet. The process is repeated again for each Totaled pivot
table value.

I just recorded the macro and it worked up to the point where there is not
data in the pivot table. At that point it stops and errors out.

This is the macro I recorded, and was trying to edit..

"Range("C8").Select
Selection.ShowDetail = True
Selection.Copy
Windows("123.csv").Activate
ActiveSheet.Paste
ActiveCell.SpecialCells(xlLastCell).Select
Range("A1").Select
ActiveCell.SpecialCells(xlLastCell).Select
Range("A132").Select
Windows("Main_Book.xlt").Activate
Sheets("Sheet1").Select
Range("F8").Select
Application.CutCopyMode = False
Selection.ShowDetail = True
Selection.Copy
Windows("123.csv").Activate
ActiveSheet.Paste
ActiveCell.SpecialCells(xlLastCell).Select
Range("A263").Select
Windows("Main_Book.xlt").Activate
Sheets("Sheet1").Select
Range("I8").Select
Application.CutCopyMode = False
Selection.ShowDetail = True
Selection.Copy
Windows("123.csv").Activate
ActiveSheet.Paste
ActiveCell.SpecialCells(xlLastCell).Select
Range("A394").Select
Windows("Main_Book.xlt").Activate
Sheets("Sheet1").Select
Range("L8").Select
Application.CutCopyMode = False
Selection.ShowDetail = True
Selection.Copy
Windows("123.csv").Activate
ActiveSheet.Paste
ActiveCell.SpecialCells(xlLastCell).Select
Range("A525").Select
Windows("Main_Book.xlt").Activate
Sheets("Sheet1").Select
Range("O8").Select
Application.CutCopyMode = False
Selection.ShowDetail = True
Selection.Copy
Windows("123.csv").Activate
ActiveSheet.Paste
ActiveCell.SpecialCells(xlLastCell).Select
Range("A656").Select
Windows("Main_Book.xlt").Activate
Sheets("Sheet1").Select
Range("R8").Select
Application.CutCopyMode = False
Selection.ShowDetail = True
Selection.Copy
Windows("123.csv").Activate
ActiveSheet.Paste

"

"Mike H." wrote:

Your explanation makes no sense because you state that each time you find
data you copy and paste the entire sheet into data. Each time you paste the
entire sheet into data you'll only have an exact replica of your original
sheet. I don't think that is what you want to do. What exactly do you want
to do?