View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Roger Govier[_3_] Roger Govier[_3_] is offline
external usenet poster
 
Posts: 2,480
Default Deleting row using vb code?

Hi

Try amending the code to

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Row = 100 Then
Rows(3).Delete
Target.EntireRow.Insert
End If
End Sub

I'm not exactly certain where you want your row inserted, so you might have
to amend the line
Target.EntireRow.Insert
to
Target.Offset(-1,0).EntireRow.Insert
to get your insertion in the correct place

--

Regards
Roger Govier

"hol" wrote in message
...
I have the following code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Row = 100 Then Rows(3).Delete
End Sub

Using this code how can I then insert a row at the bottom of the
spreadsheet?
--
hol