Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

inserting new row particular

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

ResolvedVersion 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 courses

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
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Percentage format

Ctrl+Shift+% applies the Percentage format, with no decimal places.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.