Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To Anyone who can help,
I have a three columns I am working with and a list of addresses i contained in the third. Each address listing ends in a phone number which is listed as (***)***-**** I would like to insert a row after each phone number by searching fo the first parenthesis "(". The ActivateCell function is not working a hoped. Here is the vba I have thus far: Worksheets("sheet1").Activate Range("C1").Select Dim newrng As Range, newcell As Range Set newrng = Columns(1).SpecialCells(xlConstants, xlTextValues) For Each newcell In newrng If Left(newcell.Value, 1) = "(" Then ActiveCell.EntireRow.Insert End If Next Thanks for any help -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Kilcup,
Change If Left(newcell.Value, 1) = "(" Then ActiveCell.EntireRow.Insert To: If Left(newcell.Value, 1) = "(" Then newcell(2).EntireRow.Insert HTH, Bernie MS Excel MVP "Kilcup " wrote in message ... To Anyone who can help, I have a three columns I am working with and a list of addresses is contained in the third. Each address listing ends in a phone number, which is listed as (***)***-**** I would like to insert a row after each phone number by searching for the first parenthesis "(". The ActivateCell function is not working as hoped. Here is the vba I have thus far: Worksheets("sheet1").Activate Range("C1").Select Dim newrng As Range, newcell As Range Set newrng = Columns(1).SpecialCells(xlConstants, xlTextValues) For Each newcell In newrng If Left(newcell.Value, 1) = "(" Then ActiveCell.EntireRow.Insert End If Next Thanks for any help! --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
inserting rows inbetween rows of data ? | Excel Discussion (Misc queries) | |||
Inserting rows | Excel Discussion (Misc queries) | |||
Copying & Inserting Rows w/o Affecting other Rows Etc. | Excel Worksheet Functions | |||
Inserting Blank rows after every row upto 2500 rows | Excel Worksheet Functions | |||
Inserting Rows | Excel Discussion (Misc queries) |