Results 1 to 4 of 4

Match Column A's Project number to change based on greater number in new row

Threaded View

Excelnoub Match Column A's Project... 12-01-2013, 09:19 PM
Excelnoub Re: Match Column A's Project... 12-01-2013, 10:32 PM
Excelnoub Re: Match Column A's Project... 12-01-2013, 10:58 PM
Excelnoub Re: Match Column A's Project... 12-02-2013, 10:18 AM
  1. #1
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    818

    Match Column A's Project number to change based on greater number in new row

    Good day,
    the title sound stupid but here it goes.

    I have a userform that will change information on my Sheet.

    Private Sub CommandButton1_Click()
        Application.EnableEvents = False
        Application.ScreenUpdating = False
        
        ActiveCell.Offset(1, 0).EntireRow.Insert
        Cells(ActiveCell.Row, "N").Value = Cells(ActiveCell.Row, "N").Value & "/T01"
        Cells(ActiveCell.Row, "W").Value = ComboBox4.Value
        
        Cells(ActiveCell.Row + 1, "Y").Value = "hs631"
        Range("A" & ActiveCell.Row + 1).Resize(, 12).Value = Range("A" & ActiveCell.Row).Resize(, 12).Value
        
    
        Application.EnableEvents = False
        Cells(ActiveCell.Row + 1, "M").Value = Cells(ActiveCell.Row, "M").Value + 1 'THIS is the code I need to modify or add
        
    
    
        Cells(ActiveCell.Row + 1, "N").Value = Cells(ActiveCell.Row, "A").Value & "/" & Format(TextBox1, "000") & "/HS"
        Cells(ActiveCell.Row + 1, "P").Value = TextBox5.Value
        Cells(ActiveCell.Row + 1, "Q").Value = TextBox6.Value
        Cells(ActiveCell.Row + 1, "V").Value = DateAdd("d", Val(TextBox4.Value) * 7, TextBox6.Value)
        
        If CheckBox1 = True Then
            Cells(ActiveCell.Row + 1, "U").FormulaR1C1 = "=RC[-4]+365"
        End If
        
    
        Range(Cells(ActiveCell.Row, 1), Cells(ActiveCell.Row, 29)).Copy
        Sheets("Archives").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
            
    
        Application.EnableEvents = False
        Range(Cells(ActiveCell.Row, 1), Cells(ActiveCell.Row, 29)).ClearContents
    
    
        Unload Me
        Application.EnableEvents = True
        Application.ScreenUpdating = True
    
    End Sub
    Now I have multiple project number in my Column A Row ("A5:A"): Example P123456, P123456, P123456, E123, E321 (Example only)

    Each on a different row. But all matching numbers will all have the same number in Column "M" (Example 001)

    My code tells the New row to add +1 to the number in column "M" so the 001 will become 002 but my problem is All P123456 (Let say this was the project triggered in my userform) to change all numbers 001 to 002.

    Is this possible? If so how?

    If I load in my workbook people will get lost with my instruction...But I could.

    Is there a way to imbed a code to change the numbers in my Column "M" Vs my project number to the new updated one?

    Thank you,

    Excel Noub
    Last edited by Excelnoub; 12-01-2013 at 09:21 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Add numbers to column based on order number change
    By fpmsi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-11-2013, 11:48 AM
  2. Replies: 5
    Last Post: 07-25-2013, 08:24 AM
  3. Replies: 4
    Last Post: 02-19-2013, 02:19 PM
  4. If number in culumn 'A' match set number another number in column 'I'
    By MAButler in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-10-2011, 08:29 PM
  5. MATCH-function based on column number
    By mkvassh in forum Excel General
    Replies: 4
    Last Post: 10-07-2010, 10:32 AM

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