ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can I have default data in new rows? (https://www.excelbanter.com/excel-programming/440323-can-i-have-default-data-new-rows.html)

Karl

Can I have default data in new rows?
 
I have a sheet that the first 5 rows have "administrative" data and some sums
of the data below, basically it's a "header" section, the entire worksheet
below that, the first 15 columns hold all the data for the worksheet. What I
want to do is whenever someone inserts a new row or starts on a blank row at
the bottom, to autofill some of the data within the columns, some of them are
formulas and some are simple like "Yes/No" drop down lists. Can you do a
"onNewRow" event type macro to copy formulas or is there simply a default
data fill option in excel?

Don Guillett[_2_]

Can I have default data in new rows?
 
Something like this ??

Sub insertrowwithdefaults()
ar = ActiveCell.Row
Rows(ar).Insert
Cells(ar, 1) = 12
Cells(ar, 2).Formula = "=a" & ar & "*2"
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Karl" wrote in message
...
I have a sheet that the first 5 rows have "administrative" data and some
sums
of the data below, basically it's a "header" section, the entire worksheet
below that, the first 15 columns hold all the data for the worksheet.
What I
want to do is whenever someone inserts a new row or starts on a blank row
at
the bottom, to autofill some of the data within the columns, some of them
are
formulas and some are simple like "Yes/No" drop down lists. Can you do a
"onNewRow" event type macro to copy formulas or is there simply a default
data fill option in excel?




All times are GMT +1. The time now is 09:14 AM.

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