98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Inserting a new row in a particular place | Excel forum
Inserting a new row in a particular place | Excel forum
Resolved · Medium Priority · Version 2003
Samantha has attended:
Excel VBA Intro Intermediate course
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?
RE: Inserting a new row in a particular place
Hi Samantha
Thanks 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.
Training information:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Customize the toolbar in Excel 2010You can create your own toolbar which contains your favourite or most used tools. This will make using Excel much more efficient. To do this, you need to click on View, then select Customize Quick access Toolbars and then select Customize. A list of tools will then appear on the screen of which you can add or remove them as you please. |