Results 1 to 10 of 10

If partial string = "dup" is in Column A, insert a row below that cell.

Threaded View

  1. #1
    Registered User
    Join Date
    01-15-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    25

    If partial string = "dup" is in Column A, insert a row below that cell.

    Example with Expected Outcome.xlsxExample with Expected Outcome.xlsxI'm trying to piece a bit of code together from different solutions I've come across. What I have runs but doesn't insert rows. What did I do wrong?

    Sub InsertAfterDup()
        Dim i As Long
        For i = ActiveSheet.UsedRange.Columns.Count + 1 To 2 Step -1
        If Cells(2, i).Previous = "*dup*" Then Cells(2, i).EntireColumn.Insert
    Next i
    End Sub
    Once I get this worked out, I'm trying to piece the code together that will find the max in Col. B from the two rows above the new row, and place the value in the new row, Col. B. Additionally, I want it to concatenate the original text containing the "dup" with "_max" in Col. A of the new row. I can do this manually, but there are ~50 of these "dup" rows.
    Last edited by Niedermee; 01-21-2014 at 07:18 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA to insert pictures to " insert comment " or "Text box" in cell E5 and E15
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2013, 08:10 PM
  2. [SOLVED] If there is any text in column "A$" on "sheet1" then move cell to column "A$" on "sheet2"
    By ckgeary in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2013, 08:28 PM
  3. SUMPRODUCT with "*" partial string lookup
    By timjames in forum Excel General
    Replies: 8
    Last Post: 09-02-2011, 08:54 AM
  4. Increment Cell Count If Column Contains "String"
    By Barrelroll in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-01-2010, 11:45 PM
  5. Disabling "Entire &row/&column" in Delete/Insert Cell
    By Gap in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-06-2005, 12:06 PM

Tags for this Thread

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