Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 17
Default Inserting extra lines for comments in an excel sheet

HI

I have a large excel sheet which runs into about 1,000 lines with various
information in relation to figures and peoples jobs. My problem is that I
need to insert an extra row after each individual row to insert comments and
furhter information that relate to the line above it, is there a faster way
of completing this without having to go through each individual line.
  #2   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 11,058
Default Inserting extra lines for comments in an excel sheet

run this small macro:

Sub routine()
Set r = ActiveSheet.UsedRange
nlastrow = r.Rows.Count + r.Row - 1
For i = nlastrow To 1 Step -1
Cells(i, 1).Select
Selection.EntireRow.Insert
Next
End Sub

--
Gary''s Student - gsnu200752


"LittleAnn" wrote:

HI

I have a large excel sheet which runs into about 1,000 lines with various
information in relation to figures and peoples jobs. My problem is that I
need to insert an extra row after each individual row to insert comments and
furhter information that relate to the line above it, is there a faster way
of completing this without having to go through each individual line.

  #3   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 17
Default Inserting extra lines for comments in an excel sheet

That worked thanks a million.

Just one other thing, in some of the inserted rows the comments will be the
same, is there any format of a macro that could also be used to insert text
only in the second inserted lines as was inputted from the macro below to
save time in typing it into every line??

"Gary''s Student" wrote:

run this small macro:

Sub routine()
Set r = ActiveSheet.UsedRange
nlastrow = r.Rows.Count + r.Row - 1
For i = nlastrow To 1 Step -1
Cells(i, 1).Select
Selection.EntireRow.Insert
Next
End Sub

--
Gary''s Student - gsnu200752


"LittleAnn" wrote:

HI

I have a large excel sheet which runs into about 1,000 lines with various
information in relation to figures and peoples jobs. My problem is that I
need to insert an extra row after each individual row to insert comments and
furhter information that relate to the line above it, is there a faster way
of completing this without having to go through each individual line.

  #4   Report Post  
Posted to microsoft.public.excel.setup
external usenet poster
 
Posts: 22,906
Default Inserting extra lines for comments in an excel sheet

Sub routine()
Set r = ActiveSheet.UsedRange
nlastrow = r.Rows.Count + r.Row - 1
For i = nlastrow To 2 Step -1
Cells(i, 1).Select
Selection.EntireRow.Insert
Cells(i, 1).Value = "this is a comment"
Next
End Sub

Note the change in For i = nlastrow To 2 Step -1

So's you don't insert a row above A1

This places a comment in every inserted row.

You said "some of the inserted rows" but that is too undetailed to work with.


Gord Dibben MS Excel MVP

On Wed, 31 Oct 2007 15:01:01 -0700, LittleAnn
wrote:

That worked thanks a million.

Just one other thing, in some of the inserted rows the comments will be the
same, is there any format of a macro that could also be used to insert text
only in the second inserted lines as was inputted from the macro below to
save time in typing it into every line??

"Gary''s Student" wrote:

run this small macro:

Sub routine()
Set r = ActiveSheet.UsedRange
nlastrow = r.Rows.Count + r.Row - 1
For i = nlastrow To 1 Step -1
Cells(i, 1).Select
Selection.EntireRow.Insert
Next
End Sub

--
Gary''s Student - gsnu200752


"LittleAnn" wrote:

HI

I have a large excel sheet which runs into about 1,000 lines with various
information in relation to figures and peoples jobs. My problem is that I
need to insert an extra row after each individual row to insert comments and
furhter information that relate to the line above it, is there a faster way
of completing this without having to go through each individual line.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting Lines or Copying lines with formulas but without data wnfisba Excel Discussion (Misc queries) 2 August 18th 06 04:41 PM
Pivot needs BOTH cur/cum totals w/out extra cum cols/repeat lines LRock Excel Worksheet Functions 0 April 21st 06 02:24 AM
Inserting Comments into Protected sheet TJAC Excel Discussion (Misc queries) 1 March 20th 06 06:32 PM
Inserting extra info into a cell Neil Greenough Excel Discussion (Misc queries) 4 August 5th 05 01:03 PM
?? Extra blank lines in 'address' cell after exporting to Excel Hadyn Pkok Excel Discussion (Misc queries) 4 April 15th 05 11:34 PM


All times are GMT +1. The time now is 01:07 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"