View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas[_4_] Gary Keramidas[_4_] is offline
external usenet poster
 
Posts: 226
Default insert blank row when cell changes

jim, tried that for the heck of it and it inserted 256 rows,

i put 3 names in a1:a3
in b1:b3 i entered 1,2,3 respectively

when i changed the name in a2, it inserted 256 rows

--


Gary


"Jim Thomlinson" wrote in message
...
This code needs to be inserted in the sheet. Right click the sheet tab and
select view code. Paste the following

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then _
Target.Offset(1, 0).EntireRow.Insert
End Sub

This code inserts a blank row immediately below the cell in column A that
was changed.
--
HTH...

Jim Thomlinson


"Ivano" wrote:

Hi,
I have sorted a long list of data. I now have some cells that are the
same
and then the data changes. What I want to do is insert a blank row
everytime
the cel value changes. For eg...
ColumA
John
John
Tony
Andrea
Andrea
Andrea
Ivano
Tom

So the macro would look at column A and everytime the name changes it
will
insert a blank row.

Thanks,
Ivano