ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   What's the best way to add a row and copy formulas and formats? (https://www.excelbanter.com/excel-discussion-misc-queries/77986-whats-best-way-add-row-copy-formulas-formats.html)

Michael at Sigcon

What's the best way to add a row and copy formulas and formats?
 
I have a work sheet where I enter data into the first four cells of a row and
the rest of the cells in the row are formulas. Each row is formatted
differently. What's the best way to add a new row to the bottom and have all
the formatting and formulas of the row above it?

CLR

What's the best way to add a row and copy formulas and formats?
 
Here's a crude macro that will do it for you, copy your bottom row down to
the next blank row and delete the entries in the first four cells and place
the cursor in column A of that row to facilitate new data entry..........

Sub NewRow()
'
Range("A1").Select
Selection.End(xlDown).Select
Selection.EntireRow.Copy
Selection.Offset(1, 0).Select
ActiveSheet.Paste

Range("A1").Select
Selection.End(xlDown).Select
Selection.Value = ""
Selection.Offset(0, 1).Value = ""
Selection.Offset(0, 2).Value = ""
Selection.Offset(0, 3).Value = ""

Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(1, 0).Select

End Sub

hth
Vaya con Dios,
Chuck, CABGx3



"Michael at Sigcon" wrote:

I have a work sheet where I enter data into the first four cells of a row and
the rest of the cells in the row are formulas. Each row is formatted
differently. What's the best way to add a new row to the bottom and have all
the formatting and formulas of the row above it?



All times are GMT +1. The time now is 02:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com