PDA

View Full Version : Autofill to the last Row



hart88
03-11-2012, 03:49 AM
Hi all,

I am a new user.

I would need a macro that recognize the last row and duplicate it (with autofill) in the row bellow (all formulas are suppost to be update).

Many thanks to everyone! :hi:

hart88
03-11-2012, 04:02 AM
quite important: it has only to duplicate the formula, other values in the prewius row (as quantity, price.. that are manually injected) are not suppost to be copy.

marreco
03-11-2012, 04:06 AM
Hi.

Post your spreadsheet

hart88
03-11-2012, 04:40 AM
here the spreadseet..
i would need a bottom that insert a new trade duplicating the last row (only the formulas and not the value)..
Manz thanks,

jonhaus
03-11-2012, 08:15 AM
Here is the easy way:

Copy down one additional row on your table.
Include the formulas and in data you want in this row.
Name the row template row.
Hide the row.Include this vba code.



Sub New_Trade()


Application.ScreenUpdating = False


Range("TemplateRow").Copy


Range("TemplateRow").EntireRow.Insert


Range("TemplateRow").Offset(-1, 0).EntireRow.Hidden = False


Application.CutCopyMode = False


Application.ScreenUpdating = False


End Sub

hart88
03-11-2012, 10:36 AM
hi,

i would prefer just to duplicate it.
with your macro, the formulas will be just been copied but not updated with the new cells of reference.

Many thanks,

jonhaus
03-11-2012, 11:07 AM
Something doesn't sound quite right. Have you tried using it? I tested it on your sheet and the formula references updated correctly.

If you are still having issues can you be more specific as to the problem you are encountering. I assume you are speaking of the formula in column "X".

I use this method a lot when building spreadsheet because it is easy for those not familiar with VBA to understand. If they need to make changes to the row added they just unhide and update the template row.