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