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 » VBA insert rows
VBA insert rows
Resolved · Low Priority · Version 2003
Tim has attended:
Excel Intermediate course
Outlook Advanced course
Excel VBA Intro Intermediate course
Excel Advanced course
PowerPoint Introduction course
PowerPoint Intermediate Advanced course
Excel Advanced course
Excel Advanced - For Power Users course
VBA insert rows
Could you help me with the code requirdd insert rows on multiple worksheets
RE: VBA insert rows
Hi Steve
Thanks for your question.
Can you just clarify for me the following points.
1. Do you need to insert single or multiple rows?
2. If the later, are they grouped together, or spread over the entire sheet
Thanks
Stephen
RE: VBA insert rows
Hi Stephen,
I have created some management accounts with a worksheet for each cost centre. If then we want to create a new line in the accounts, a new type of travel cost etc., I want to be able to insert a new line in each cost centres accounts and add into the line the name of the new cost and a formula.
Hope that is clearer.
Cheers
Tim
RE: VBA insert rows
Hi Tim
Thanks for the update.
I suggest the following approach
1. Use a "For each" loop to go to each worksheet in the workbook.
2. Within the loop (for each sheet), insert a new row in the appropriate place. The following is a sample of code for this.
Range("A2").Rows.Insert shift:=xlDown
3. set the new cost and formula as the values of the relevant cell.
Hope this helps
Regards
Stephen
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:How to select certain data in an Excel 2010 workbookIf you want to select the correct data set in a page full of data, the most accurate and efficient way of doing this is to use the ''Shift and Click'' technique. |