Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Inserting a new row in a particular place
Inserting a new row in a particular place
Resolved · Medium Priority · Version 2003
Inserting a new row in a particular place
I have a password protected spreadsheets that users input data into. The data area has a number of rows and then a protected row at the bottom which has formulae in to tal the above data.I'd like to write a code so that the user of a spreadsheet can insert a new row by clicking a button and it adds the row at the bottom of the data area but above the total row and also updates the total row formulae to include the new row!
Does this sound possible ad any pointers on where to start?
For upcoming training course dates see: Pricing & availability
RE: Inserting a new row in a particular place
Hi SamanthaThanks for your question
You can insert a row at the bottom of your data with the following
code
Dim intLastRow
intLastRow = sheets(1).Range("A1").CurrentRegion.Rows.Count
Sheets(1).Rows(intLastRow).Insert
This imply calculates the last row number and inserts a row there. If the last row contains formulae, then they will update automatically
Regards
Stephen
Thu 29 Jul 2010: Automatically marked as resolved.
|
|
» Forum post: Macros |
Differences In Excel 2003, 2007 And 2010 If you're thinking about an upgrade to Excel 2010, then it's worth apprising yourself of the differences beforehand. Will it be worth it? Find out about these new features and understand what the terms mean before you make your decision to upgrade. » Article: Microsoft training london |



Course updates

