Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-05-2015, 08:59 AM
Officer_Bierschnitt Officer_Bierschnitt is offline Select an entire line (to insert one) Windows 7 64bit Select an entire line (to insert one) Office 2013
Advanced Beginner
Select an entire line (to insert one)
 
Join Date: Oct 2015
Posts: 79
Officer_Bierschnitt is on a distinguished road
Default Select an entire line (to insert one)

Hi,

I have a macro that reads all the linked files (which are referenced in some formula or other) and stores those in a variable named aLnks.
=> Then there is a loop going through these line by line with a counter_variable "i";
=> To avoid the risk of overwriting anything by filling lines with this new data, I want to select each new line and insert a new one (each time shifting the existing lines downward)

=> What is the syntax for the SELECT statement I need to select the entire line (I calculate the line depending on the counter like
>> (i + 10) <<
(for i=1, that would be line 11 etc.))

Thanks a lot!

Best regards,



DataNibbler

P.S.: The code >>Range((i+10)i+10)).Select<< outputs the error_message "Missing list_separator or )" with the colon highlighted
Reply With Quote
  #2  
Old 11-05-2015, 12:08 PM
NoSparks NoSparks is offline Select an entire line (to insert one) Windows 7 64bit Select an entire line (to insert one) Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

When you used the macro recorder to see how VBA selects a row, did it use Range.Select ?
Reply With Quote
  #3  
Old 11-06-2015, 01:43 AM
Officer_Bierschnitt Officer_Bierschnitt is offline Select an entire line (to insert one) Windows 7 64bit Select an entire line (to insert one) Office 2013
Advanced Beginner
Select an entire line (to insert one)
 
Join Date: Oct 2015
Posts: 79
Officer_Bierschnitt is on a distinguished road
Default

Hi,

yes, the code was like
>> Range(18:18).Select <<
That is simple enough - the nr. 18 is in my variable - well, the variable might have the value 5 and I know I have to add 13 lines.

<=> But the code >> Range((i+13)i+13)).Select << returns an error.

How can I do that?

Thanks a lot!

Best regards,

Officer_Bierschnitt

P.S.: That sad smiley should have been a colon and the error_message is "expected list separator or )"
Reply With Quote
  #4  
Old 11-06-2015, 03:05 AM
Officer_Bierschnitt Officer_Bierschnitt is offline Select an entire line (to insert one) Windows 7 64bit Select an entire line (to insert one) Office 2013
Advanced Beginner
Select an entire line (to insert one)
 
Join Date: Oct 2015
Posts: 79
Officer_Bierschnitt is on a distinguished road
Default

Okay,

I made it.
I figured out when I select one cell in that row, I can use
>> Selection.EntireRow.Select << to - select the entire row ;-)

Best regards,

Officer_Bierschnitt
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Select an entire line (to insert one) How to select and copy to clipboard an entire document except for a paragraph and keep formatting TD_123 Word VBA 7 06-16-2015 03:30 PM
Select an entire line (to insert one) VBA code for Microsoft Word macro — select text and insert footnote ndnd Word VBA 10 01-06-2015 01:47 PM
Select an entire line (to insert one) Can I select the entire second or third level in an org. chart? blockie Word 1 08-25-2014 11:19 PM
How to use an ActiveX Control to insert a multi select listbox in Word marksm33 Word 2 01-29-2014 05:21 PM
Select an entire line (to insert one) Word XP - Can't select line RogerM Word 2 03-11-2011 01:26 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:14 AM.


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