LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 176
Default Copying Macro

Hi

I run Win XP with Excel 2K

I have a worksheet with a pivot table on it. I would like to copy the grand
totals of the pivot table into another worksheet.

What i need is to have a macro that highlights the range in the pivot table
and copies it to the next worksheet. The copied data should go into the next
available blank row of the work sheet.

I have tried recording this macro and it works fine the first time I run it
but the next time I run it it copies over the last entry instead of going to
the next blank row. This is despite the fact that when I record the macro I
go to the column that I want the data to be copied too, press End and Down
which takes me too the last row and I then press the down arrow to take it to
the next blank cell.

This is the macro I recorded.

Sub CopyData1()

Range("B38:F38").Select
Selection.Copy
Sheets("DATA 2").Select
Range("C2").Select
Selection.End(xlDown).Select
Range("C47").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

End Sub


Obviously this probelm is caused by the Range("C47").Select in the code.

I would have thought that when I recorded the macro then when I selected the
arrow down at the end of the data that it would be reflected in the code.

I hope I have explaied this ok.

Can anyone help?


Thanks

John



























to the next sheet
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copying using a macro divad Excel Worksheet Functions 3 June 27th 08 09:49 PM
Copying a Macro Keepsmiling1228 Excel Discussion (Misc queries) 1 March 31st 08 05:31 PM
Macro for Copying Frank Situmorang[_2_] Excel Worksheet Functions 9 January 29th 08 08:04 AM
copying with a Macro DonT Excel Worksheet Functions 2 March 24th 06 07:45 PM
Copying with a macro DonT Excel Worksheet Functions 2 March 23rd 06 03:04 AM


All times are GMT +1. The time now is 07:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"