Results 1 to 9 of 9

Compile error Method or data member not found

Threaded View

  1. #1
    Registered User
    Join Date
    01-12-2014
    Location
    Plano, Tx
    MS-Off Ver
    365
    Posts
    57

    Compile error Method or data member not found

    Excel 10
    I am getting this error, method or data member not found on a Userform Text box label. All the other text boxes seem to work fine. I checked the properties and it is spelled correctly. I'm sure it's in my code somewhere. Here is the line of code getting the error:
    ElseIf Label_Date.Value = "" Then

    Here is my full code:

     Private Sub CommandButton_Close_Click()
     Unload Me
     End Sub
     Private Sub Label_Contacted_Click()
     End Sub
     Private Sub OptionButton1_Click()
     End Sub
     Private Sub OptionButton2_Click()
     End Sub
     Private Sub OptionButton3_Click()
     End Sub
     Private Sub UserForm_Initialize() 'List of 35 stores on the "Stores" worksheet
     For i = 1 To 35
     ComboBox_Country.AddItem Sheets("Stores").Cells(i, 1)
     Next
     End Sub
     Private Sub OptionButton4_Click()
     End Sub
     Private Sub UserForm1_Initialize() 'List of Type of Complaints on the "Type" worksheet
     For i = 1 To 6
     ComboBox_Country1.AddItem Sheets("Type").Cells(i, 1)
     Next
     End Sub
     Private Sub CommandButton_Add_Click()
     'Setting Label color to black
     Label_Last_Name.ForeColor = RGB(0, 0, 0)
     Label_First_Name.ForeColor = RGB(0, 0, 0)
     Label_Address.ForeColor = RGB(0, 0, 0)
     Label_Place.ForeColor = RGB(0, 0, 0)
     Label_Country.ForeColor = RGB(0, 0, 0)
     Label_Date.ForeColor = RGB(0, 0, 0)
     Label_Country1.ForeColor = RGB(0, 0, 0)
     'Content controls
     If TextBox_Last_Name.Value = "" Then 'If no "name" provided ...
     Label_Last_Name.ForeColor = RGB(255, 0, 0) 'Set Label "name" color to red
     ElseIf TextBox_First_Name.Value = "" Then
     Label_First_Name.ForeColor = RGB(255, 0, 0)
     ElseIf TextBox_Address.Value = "" Then
     Label_Address.ForeColor = RGB(255, 0, 0)
     ElseIf TextBox_Place.Value = "" Then
     Label_Place.ForeColor = RGB(255, 0, 0)
     ElseIf ComboBox_Country.Value = "" Then
     Label_Country.ForeColor = RGB(255, 0, 0)
     ElseIf Label_Date.Value = "" Then
     Label_Date.ForeColor = RGB(255, 0, 0)
     ElseIf ComboBox_Country1.Value = "" Then
     Label_Country1.ForeColor = RGB(255, 0, 0)
     Else
    
     'If the form is complete, the values will be inserted onto the worksheet
     Dim row_number As Integer, contacted As String
    
     'Choice of salutation
     For Each contacted_button In Frame_Salutation.Controls
     If contacted_button.Value Then
     contacted = contacted_button.Caption
     End If
     Next
     'row_number = row number of the last non-empty cell in column +1
     row_number = Range("A65536").End(xlUp).Row + 1
     'Inserting values onto the worksheet
     Cells(row_number, 1) = contacted
     Cells(row_number, 2) = TextBox_Last_Name.Value
     Cells(row_number, 3) = TextBox_First_Name.Value
     Cells(row_number, 4) = TextBox_Address.Value
     Cells(row_number, 5) = TextBox_Place.Value
     Cells(row_number, 6) = ComboBox_Country.Value
     Cells(row_number, 7) = TextBox_Date.Value
     Cells(row_number, 8) = ComboBox_Country1.Value
     'After insert, we replace the initial values
     OptionButton1.Value = True
     TextBox_Last_Name.Value = ""
     TextBox_First_Name.Value = ""
     TextBox_Address.Value = ""
     TextBox_Place.Value = ""
     ComboBox_Country.ListIndex = -1
     TextBox_Date.Value = ""
     ComboBox_Country1.ListIndex = -1
     End If
     End Sub
    Last edited by 6StringJazzer; 08-29-2016 at 03:40 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Compile error: Method or data member not Found
    By jasond1992 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-25-2015, 02:29 AM
  2. [SOLVED] Compile error: Method or data member not found
    By aliciaward1001 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-26-2015, 04:11 PM
  3. Compile error:Method or data member not found
    By vshukla in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2015, 11:44 AM
  4. Compile error method or data member not found
    By sureshpunna in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2014, 09:00 AM
  5. Compile Error Method or data member not found
    By ixelister in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-23-2014, 03:39 PM
  6. [SOLVED] Compile error: Method or data member not found.
    By ndtsteve in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-10-2012, 11:31 AM
  7. [SOLVED] Compile Error Method or data member not found
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2005, 06:05 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