+ Reply to Thread
Results 1 to 4 of 4

Expected: list separator or ) Error Code

  1. #1
    Registered User
    Join Date
    03-07-2015
    Location
    pigeon forge tn
    MS-Off Ver
    2010
    Posts
    14

    Expected: list separator or ) Error Code

    Im getting this error code on this part of the code without it everything works fine. """.Cells(1Row, 9).Value = Format(Now(), "dd/mm/yyyy hh:mm:ss")"""""

    I just want to be able to add a timestamp.

    Here is the full code:

    Sub cmdSubmit_Click()
    Dim ctl As Control
    'Check User Input
    If Me.txtApparatus.Value = "" Then
    MsgBox "Please enter Apparatus.", vbExclamation, "Form Error"
    Me.txtApparatus.SetFocus
    Exit Sub
    End If
    If Me.txtReporter.Value = "" Then
    MsgBox "Please enter your Name.", vbExclamation, "Form Error"
    Me.txtReporter.SetFocus

    Exit Sub
    End If

    'Write data to worksheet

    'Copy input values to sheet.
    Dim lRow As Long
    Dim ws As Worksheet
    Set ws = Worksheets("Maintenance")
    lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    With ws
    .Cells(lRow, 1).Value = Me.txtApparatus.Value
    .Cells(lRow, 2).Value = Me.txtAppearance.Value
    .Cells(lRow, 3).Value = Me.cboPriority1.Value
    .Cells(lRow, 4).Value = Me.txtMechanical.Value
    .Cells(lRow, 5).Value = Me.cboPriority2.Value
    .Cells(lRow, 6).Value = Me.txtElectrical.Value
    .Cells(lRow, 7).Value = Me.cboPriority3.Value
    .Cells(lRow, 8).Value = Me.txtReporter.Value
    .Cells(1Row, 9).Value = Format(Now(), "dd/mm/yyyy hh:mm:ss")
    End With

    'Clear the form
    For Each ctl In Me.Controls
    If TypeName(ctl) = "TextBox" Or TypeName(ctl) = "ComboBox" Then
    ctl.Value = ""

    Unload Me
    End If
    Next ctl
    End Sub

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,794

    Re: Expected: list separator or ) Error Code

    Should not

    Please Login or Register  to view this content.
    be

    Please Login or Register  to view this content.
    Alf

  3. #3
    Registered User
    Join Date
    03-07-2015
    Location
    pigeon forge tn
    MS-Off Ver
    2010
    Posts
    14

    Re: Expected: list separator or ) Error Code

    I change that and now getting Run time error 1004, application defined or object defined error

    It inputs the data except for the timestamp

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,794

    Re: Expected: list separator or ) Error Code

    Strange, I tested but got no problem with your settup i.e.

    Please Login or Register  to view this content.
    after changing the 1 to l.

    Result gave me date + hrs, mm and ss.

    Alf

+ 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. Please solve the Error : Expected List separator..
    By ANUARORA in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2014, 10:05 AM
  2. Please solve the Error : Expected List separator..
    By ANUARORA in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-23-2014, 09:51 AM
  3. Complie Error: Expected: list separator or (
    By Poornima Rajgopal in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-07-2013, 12:32 PM
  4. [SOLVED] Continue code on next line: Compile Error: expected list separator or )
    By ike609 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-05-2012, 08:28 AM
  5. compile error – expected : list separator or )
    By mdavid800 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-27-2011, 04:59 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