L
Linda
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
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