Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 205
Default Macro to insert lines

I'm trying to write a marco to search for a certain value in column A. When
the value is found, I want to insert a blank line above it. Once this is
done, I want to repeat the process for the entire worksheet.

Here's the macro I wrote. The problem is that is keeps inserting the blank
row at the top of the worksheet. It doesn't move to the next value. I'm not
sure how to write the code for this.

Sub PV1insertblank()
'
' PV1insertblank Macro
' Macro recorded 4/10/2009 by krauli20
'
' Keyboard Shortcut: Ctrl+q
'
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.Find(What:="PV1", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Rows("1:1").EntireRow.Select
Selection.Insert Shift:=xlDown
Selection.Interior.ColorIndex = xlNone
End Sub
Sub Macro6()
'
' Macro6 Macro
' Macro recorded 4/10/2009 by krauli20
'

'
End Sub

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
macro to insert lines for 3 sections Don Excel Discussion (Misc queries) 0 June 12th 08 02:31 AM
macro to insert blank line when lines sum to zero TCoats Excel Discussion (Misc queries) 0 July 2nd 07 05:08 PM
insert lines abunge Excel Discussion (Misc queries) 3 June 5th 06 09:02 AM
Macro to insert blank lines Terry Pinnell Excel Discussion (Misc queries) 6 October 21st 05 11:21 PM
Macro insert lines Esrei Excel Discussion (Misc queries) 4 August 11th 05 11:51 AM


All times are GMT +1. The time now is 01:53 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"