Results 1 to 4 of 4

loop with inserting cells

Threaded View

  1. #1
    Registered User
    Join Date
    10-15-2010
    Location
    Sacramento, CA
    MS-Off Ver
    Excel 2007
    Posts
    56

    Talking loop with inserting cells

    Hi, I'm trying to do a loop, which I have, but need some adjustments. The loop is to go down and whenever it finds 1324l it will insert a row in that column, pushing it to the right, about 3 times. What I have is
    Sub test()

    Range("b8").Select
    If ActiveCell.Offset(0, 2) = "1324I" Then
    Do
    Selection.insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
    ActiveCell.Offset(1, 0).Select
    Loop Until ActiveCell.Offset = 1

    End If
    what this is doing is inserting in every row a cell and pushing it to the right 1. What I would like it to do is insert a cell ONLY when it finds 1324l, and I want it to insert 3 rows. Any help would be great!
    thanks,
    Attached Files Attached Files
    Last edited by gill389; 01-18-2011 at 04:29 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1