+ Reply to Thread
Results 1 to 6 of 6

Could not get Column property,Invalid argument

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    Could not get Column property,Invalid argument

    i added the first bit of code to the code below as demonstrated and now i get topic error
    findvalue.Offset(0, 3).Value = Me.Txt_OTRate.Value
    findvalue.Offset(0, 2).Value = Me.Txt_OTAfter.Value
    findvalue.Offset(0, 3).Value = Me.Txt_OTRate.Value
    findvalue.Offset(0, 2).Value = Me.Txt_OTAfter.Value
    findvalue.Offset(0, -1).Value = Me.txt_Notes.Value             '*****this is the col just before ID
    findvalue.Offset(0, -2).Value = Me.Txt_NoRate.Value
    findvalue.Offset(0, -3).Value = Me.Txt_SunNR.Value
    findvalue.Offset(0, -4).Value = Me.Txt_SunDR.Value
    findvalue.Offset(0, -5).Value = Me.Txt_SNR.Value
    findvalue.Offset(0, -6).Value = Me.Txt_Mobile_Number.Value
    findvalue.Offset(0, -7).Value = Me.Txt_Con_Number.Value
    findvalue.Offset(0, -8).Value = Me.Txt_Con_PostCode.Value
    findvalue.Offset(0, -9).Value = Me.Txt_Con_Addy_Twn.Value
    findvalue.Offset(0, -10).Value = Me.Txt_Con_Addy_St.Value
    findvalue.Offset(0, -11).Value = Me.Txt_Contract_Name.Value
    findvalue.Offset(0, -12).Value = Me.Txt_Agency.Value             '*****this is your first col
    Call MsgBox("The Contract has been updated", vbInformation, "Edit Contract")
    0 is where my ID is. any suggestions please

  2. #2
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    Re: Could not get Column property,Invalid argument

    this is the whole code to my edit button as it sits right now

    Private Sub cmdEdit_Click()
    'error handler
    On Error GoTo cmdEdit_Click_Error
    'check that there is data to edit
    If Me.txt_Notes = "" Then
    Call MsgBox("The fields are not complete", vbInformation, "Edit Contract") '*****Change Contact to file name
    Exit Sub
    End If
    'find the value in case of duplicates we use an ID
    Sheet6.Range("a1") = txtID.Value
    Set findvalue = Sheet6.Range("N8:N10000").Find(What:=Me.txtID, LookIn:=xlValues)
    'findvalue.Value = Me.txtID "we do not want to edit the ID"
    '*****These names go in reverse from last col to first*****
    findvalue.Offset(0, 3).Value = Me.Txt_OTRate.Value
    findvalue.Offset(0, 2).Value = Me.Txt_OTAfter.Value
    findvalue.Offset(0, -1).Value = Me.txt_Notes.Value             '*****this is the col just before ID
    findvalue.Offset(0, -2).Value = Me.Txt_NoRate.Value
    findvalue.Offset(0, -3).Value = Me.Txt_SunNR.Value
    findvalue.Offset(0, -4).Value = Me.Txt_SunDR.Value
    findvalue.Offset(0, -5).Value = Me.Txt_SNR.Value
    findvalue.Offset(0, -6).Value = Me.Txt_Mobile_Number.Value
    findvalue.Offset(0, -7).Value = Me.Txt_Con_Number.Value
    findvalue.Offset(0, -8).Value = Me.Txt_Con_PostCode.Value
    findvalue.Offset(0, -9).Value = Me.Txt_Con_Addy_Twn.Value
    findvalue.Offset(0, -10).Value = Me.Txt_Con_Addy_St.Value
    findvalue.Offset(0, -11).Value = Me.Txt_Contract_Name.Value
    findvalue.Offset(0, -12).Value = Me.Txt_Agency.Value             '*****this is your first col
    Call MsgBox("The Contract has been updated", vbInformation, "Edit Contract")
    
    'reset error
    On Error GoTo 0
    Exit Sub
    'if error occurs then show me exactly where the error occurs
    cmdEdit_Click_Error:
    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure cmdEdit_Click of Form Contract"
    End Sub

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Could not get Column property,Invalid argument

    What line errors with what message?
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275
    Quote Originally Posted by shg View Post
    What line errors with what message?
    It comes up with my userform. Ive plenty of columns.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Could not get Column property,Invalid argument

    What line of code fails, with what error message?

  6. #6
    Forum Contributor
    Join Date
    03-30-2015
    Location
    Northampton
    MS-Off Ver
    2010
    Posts
    275

    Re: Could not get Column property,Invalid argument

    Quote Originally Posted by shg View Post
    What line of code fails, with what error message?
    i gave up and redesigned my worksheet (not tested yet but should work)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Getting compile error 'Wrong number of argument or invalid property assignment'
    By mso3 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-17-2014, 07:50 AM
  2. Runtime error 381: Could not set the list property.Invalid property array index
    By rohith4prithvi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-23-2014, 10:24 PM
  3. [SOLVED] Excel run-time error '381': Could not set the List property. Invalid property array index
    By eemiller1997 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-20-2012, 12:48 PM
  4. Replies: 3
    Last Post: 04-28-2010, 05:54 PM
  5. Error: Wrong number of argument or invalid property assignment?
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2006, 01:35 PM

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