PC Review


Reply
Thread Tools Rate Thread

copy last row with formulas and paste into next row same sheet

 
 
mgaz
Guest
Posts: n/a
 
      7th Mar 2007
Hi, i want to copy the last row in my worksheet (always starts with a
date) and then paste it into the next row, then fixing the values in
the first row.
I want it to be dynamic but with the sub i have so far it only applies
to rows 533...?
can anyone help?


Sub Macro1
Range("A528:AY528").Select
Selection.Copy

Range("A534").Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone,
_
SkipBlanks:=False, Transpose:=False
Application.Calculate
Range("A533:AY533").Select
Application.CutCopyMode = False
Selection.Copy

Range("A533").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats,
Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
End Sub

 
Reply With Quote
 
 
 
 
merjet
Guest
Posts: n/a
 
      7th Mar 2007
Replace:
> Range("A533:AY533").Select
> Application.CutCopyMode = False
> Selection.Copy
>
> Range("A533").Select


With:
iEnd = Range("A65536").End(xlUp).Row - 1
Range("A" & iEnd & ":AY" & iEnd).Select
Application.CutCopyMode = False
Selection.Copy
Range("A" & iEnd).Select

I didn't test this. I believe the - 1 is needed because your earlier
code put something in row 534, but maybe not.

Hth,
Merjet


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Paste from Class Sheet to Filtered List on Combined Sheet prkhan56@gmail.com Microsoft Excel Programming 6 16th Sep 2008 04:30 PM
Help to code Macro to Copy fron one sheet and paste in other sheet kay Microsoft Excel Programming 3 25th Jul 2008 06:46 PM
Cannot paste a block of formulas from one sheet to another Anon Microsoft Excel Discussion 5 18th Jun 2008 05:52 PM
Copy from one Sheet and paste on another sheet based on condition Prem Microsoft Excel Misc 2 24th Dec 2007 05:05 AM
automatic copy and paste from sheet to sheet in a workbook =?Utf-8?B?cmFtc2V5anJhbXNleWo=?= Microsoft Excel Programming 6 11th Dec 2004 12:37 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:24 AM.