View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
robertjtucker[_5_] robertjtucker[_5_] is offline
external usenet poster
 
Posts: 1
Default Insert 19 cells "Shift to the right" if cell contains "-"


I have this and it works, it inserts cells until it gets out of the
range but takes way to long. One at a time. Any one have any ideas on
how to get it insert 19 cells at a time or outside the range.


Sub Macro64()

With Worksheets("Imported").Range("imp2")
Set c = .Find("-", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Insert Shift:=xlToRight

Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < firstAddress
End If
End With

End Sub


--
robertjtucker
------------------------------------------------------------------------
robertjtucker's Profile: http://www.excelforum.com/member.php...o&userid=21805
View this thread: http://www.excelforum.com/showthread...hreadid=389337