Results 1 to 5 of 5

Insert argument in code

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Waterbury, CT
    MS-Off Ver
    Office 365
    Posts
    1,175

    Insert argument in code

    Hello everyone.
    When the below code with this workbook Save_Update Customer.xlsm is hit the customer in sheets "Customer" updates the existing customer in "Sheet1".
    Can anyone add to my code that if the customer does not exist in "Sheet1" it would instead add the customer below the last customer?

    Sub Button3_Click()
    Dim CustomerName
    Dim WkRow
    Dim Test As Boolean
        CustomerName = Range("A59")
        WkRow = Evaluate("=MATCH(""" & CustomerName & """,Sheet1!$A:$A,0)")
        Test = Application.WorksheetFunction.IsNumber(WkRow)
        If (Test) Then
            Rows(59 & ":" & 59).Copy
            With Sheets("Sheet1")
                .Rows(WkRow & ":" & WkRow).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                    :=False, Transpose:=False
            End With
        End If
    End Sub
    Thanks in advance
    Last edited by kosherboy; 04-04-2014 at 10:10 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Argument not optional error is occurring in goal seek automated code.
    By bk1202 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-21-2013, 08:32 AM
  2. [SOLVED] split the code while argument is not affected
    By ck_123 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-15-2013, 09:53 AM
  3. [SOLVED] ByRef argument type mismatch / Passing array as a function argument
    By pzling in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-29-2012, 06:23 PM
  4. Replies: 3
    Last Post: 04-28-2010, 05:54 PM
  5. [SOLVED] Function (array argument, range argument, string argument) vba
    By Witek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2005, 11:07 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