Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Add new rows after specific rows

Hello!

I would like to add a new row after each row that contains the value "SHOW
MOVIE_PLAYER" in column F (that is, column F contains a number of different
values, and I just want a new row after the ones with that specific value).

I COULD just insert a new row manually, but there´s about 500 of them...

Can anyone help me with this?

Thanks
/Dipladenia
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Add new rows after specific rows

Additional info: I´m using Excel 2003 SP2

/Dipladenia


"Dipladenia" skrev:

Hello!

I would like to add a new row after each row that contains the value "SHOW
MOVIE_PLAYER" in column F (that is, column F contains a number of different
values, and I just want a new row after the ones with that specific value).

I COULD just insert a new row manually, but there´s about 500 of them...

Can anyone help me with this?

Thanks
/Dipladenia

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Add new rows after specific rows

Public Sub ProcessData()
Const TEST_COLUMN As String = "F" '<=== change to suit
Dim i As Long
Dim iLastRow As Long

With ActiveSheet

iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = iLastRow To 1 Step -1
If .Cells(i, TEST_COLUMN).Value = "SHOW MOVIE_PLAYER" Then
.Rows(i + 1).Insert
End If
Next i
End With

End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Dipladenia" wrote in message
...
Hello!

I would like to add a new row after each row that contains the value "SHOW
MOVIE_PLAYER" in column F (that is, column F contains a number of
different
values, and I just want a new row after the ones with that specific
value).

I COULD just insert a new row manually, but there´s about 500 of them...

Can anyone help me with this?

Thanks
/Dipladenia



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Add new rows after specific rows

how do I get this to work in 2007?
--
THANKS!
mg


"Bob Phillips" wrote:

Public Sub ProcessData()
Const TEST_COLUMN As String = "F" '<=== change to suit
Dim i As Long
Dim iLastRow As Long

With ActiveSheet

iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = iLastRow To 1 Step -1
If .Cells(i, TEST_COLUMN).Value = "SHOW MOVIE_PLAYER" Then
.Rows(i + 1).Insert
End If
Next i
End With

End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Dipladenia" wrote in message
...
Hello!

I would like to add a new row after each row that contains the value "SHOW
MOVIE_PLAYER" in column F (that is, column F contains a number of
different
values, and I just want a new row after the ones with that specific
value).

I COULD just insert a new row manually, but there´s about 500 of them...

Can anyone help me with this?

Thanks
/Dipladenia




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Add new rows after specific rows

Same way it works in previous versions.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

gaddis wrote:

how do I get this to work in 2007?
--
THANKS!
mg

"Bob Phillips" wrote:

Public Sub ProcessData()
Const TEST_COLUMN As String = "F" '<=== change to suit
Dim i As Long
Dim iLastRow As Long

With ActiveSheet

iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = iLastRow To 1 Step -1
If .Cells(i, TEST_COLUMN).Value = "SHOW MOVIE_PLAYER" Then
.Rows(i + 1).Insert
End If
Next i
End With

End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Dipladenia" wrote in message
...
Hello!

I would like to add a new row after each row that contains the value "SHOW
MOVIE_PLAYER" in column F (that is, column F contains a number of
different
values, and I just want a new row after the ones with that specific
value).

I COULD just insert a new row manually, but there´s about 500 of them...

Can anyone help me with this?

Thanks
/Dipladenia





--

Dave Peterson
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
AVERAGEIF specific rows Thomas [PBD] Excel Discussion (Misc queries) 11 May 7th 07 07:15 PM
Hiding Specific Rows Based on Values in Other Rows Chris Excel Worksheet Functions 1 November 2nd 06 08:21 PM
Copying specific rows Eric Montelongo Excel Worksheet Functions 1 June 20th 06 08:08 PM
inserting specific # of rows cwinters Excel Discussion (Misc queries) 1 June 6th 05 07:30 PM
Deleting Specific Rows ScaffoldingDepot Excel Discussion (Misc queries) 2 May 4th 05 04:08 PM


All times are GMT +1. The time now is 04:57 AM.

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"