Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-22-2013, 07:09 AM
C J Squibb C J Squibb is offline Add multiple rows to Excel 2010 table at cursor position Windows 7 64bit Add multiple rows to Excel 2010 table at cursor position Office 2010 32bit
Novice
Add multiple rows to Excel 2010 table at cursor position
 
Join Date: Aug 2013
Location: Essex
Posts: 14
C J Squibb is on a distinguished road
Default Add multiple rows to Excel 2010 table at cursor position

I am trying to add multiple rows to my Excel table (the number to be specified by an inputbox). The rows should go in starting at the current cursor position. I want to add Table rows, not worksheet rows.

My first problem was that I found myself unable to identify the current table row using [#This Row], so have had to resort to using absolute row numbers, subtracting the header row from the current worksheet row to give me the table row number. Using this, I can add a single row at my required location with this line of code:
Code:
Selection.ListObject.ListRows.Add (intCurRow - intHeader)
However, the code simply exits at this point, so I can't use a For...Next or Do...Until loop to add multiple rows.

Is there a way to add multiple table rows with a single command, or to make this code run round a loop?
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula that can merge multiple rows with the same ID into one row Hilwey Excel 3 07-08-2015 08:50 PM
Add multiple rows to Excel 2010 table at cursor position Word 2010 and Excel 2010 Mail merge - multiple headers robby Word 3 04-18-2012 06:37 PM
Displaying cursor position within cell MiamiTom Excel 0 11-18-2011 09:02 AM
Add multiple rows to Excel 2010 table at cursor position Setting cursor after last Table of Contents DugganSC Word 1 09-07-2011 11:42 AM
Retrieve position of Cursor - x & y positions SDondeti PowerPoint 0 05-19-2011 11:39 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:05 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft