Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jim,
I insterted it into the sheet. Now what. I tried the Run symbol but I get an error. I tried a few things but I couldn't get it to execute. What do I have to do to get it going? Thanks "Jim Thomlinson" wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert blank row after change in cell value not working. | Excel Discussion (Misc queries) | |||
How to insert a slash into a blank cell | New Users to Excel | |||
Auto insert a blank row above the current row based on a cell val. | Excel Discussion (Misc queries) | |||
insert info only if cell is blank (Max from Singapore ref) | Excel Discussion (Misc queries) | |||
if cell is blank insert a zero | Excel Discussion (Misc queries) |