Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy last row with formulas and paste into next row same sheet

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default copy last row with formulas and paste into next row same sheet

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
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
Copy and Paste formulas GG Excel Discussion (Misc queries) 1 October 30th 08 05:36 AM
Copy/Paste formulas BobG Excel Discussion (Misc queries) 3 February 18th 05 05:11 PM
Copy & Paste formulas Urgent Excel Programming 3 January 25th 05 10:47 PM
copy and paste formulas Jim Excel Worksheet Functions 4 January 14th 05 06:17 PM
Copy & Paste without the formulas Steven Cheng[_2_] Excel Programming 2 July 31st 03 09:43 PM


All times are GMT +1. The time now is 01:54 PM.

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

About Us

"It's about Microsoft Excel"