+ Reply to Thread
Results 1 to 5 of 5

User Form error - type 13 mismatch -

  1. #1
    Registered User
    Join Date
    01-22-2018
    Location
    Poland
    MS-Off Ver
    2016
    Posts
    3

    User Form error - type 13 mismatch -

    Hi Guys,

    Could you please take a look into the following code and advise what is wrong and causing the type 13 mismatch error?

    The case is that the error message came up when I decided to include "BHD" text together with ticket number (highlited)
    'Write Value
    issSheet.Cells(Me.tbTicketNo.Value + 5, 1) = Me.tbTicketNo.Value
    issSheet.Cells(Me.tbTicketNo.Value + 5, 10) = Me.cmbOpenBy.Value
    issSheet.Cells(Me.tbTicketNo.Value + 5, 2) = Me.cmbCustID.Value
    issSheet.Cells(Me.tbTicketNo.Value + 5, 3) = Me.cmbCustName.Value
    issSheet.Cells(Me.tbTicketNo.Value + 5, 4) = Me.cmbCustPhone.Value
    issSheet.Cells(Me.tbTicketNo.Value + 5, 7) = Me.tbIssue.Value
    issSheet.Cells(Me.tbTicketNo.Value + 5, 11) = Me.cmbSEV.Value
    issSheet.Cells(Me.tbTicketNo.Value + 5, 14) = CDate(Me.tbDateOpen.Value)
    issSheet.Cells(Me.tbTicketNo.Value + 5, 16) = CDate(Me.tbDateOpen.Value)


    Private Sub btwNewTicket_Click()
    ClearFields
    Range("A" & Rows.Count).End(xlUp).Select
    LastRow = "bhd" & ThisWorkbook.Sheets("Issue Log").Cells(Rows.Count, 1).End(xlUp).Row - 4
    Me.tbTicketNo.Value = "BHD" & LastRow
    Me.tbTicketNo.Locked = True
    Me.tbDateOpen = Date
    Me.btnAccept.Caption = "Create"
    Me.btnAccept.Enabled = True
    End Sub

    Thank you in advance !

    Regards

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: User Form error - type 13 mismatch -

    "LastRow = "bhd" & ThisWorkbook.Sheets("Issue Log").Cells(Rows.Count, 1).End(xlUp).Row - 4
    Me.tbTicketNo.Value = "BHD" & LastRow"?

    Does lastrow end up being a number or a text?

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: User Form error - type 13 mismatch -

    Which line of code is causing the error?
    If posting code please use code tags, see here.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: User Form error - type 13 mismatch -

    Hi,

    You can't add 5 to the text "BHD1" for example. You need to remove the BHD part to get the row number
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Registered User
    Join Date
    01-22-2018
    Location
    Poland
    MS-Off Ver
    2016
    Posts
    3

    Re: User Form error - type 13 mismatch -

    Thank you xlnitwit, it works now!

+ 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] Type Mismatch 13 - 1 User Only
    By Nulladave in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-22-2016, 07:00 AM
  2. Type Mismatch Error in Data Entry Form
    By sj9ers in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-01-2016, 12:43 PM
  3. [SOLVED] Combo Box in User Form gives a Type Mismatch Error
    By Rudidw in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-13-2015, 05:31 AM
  4. type mismatch error in form code
    By jay11 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-17-2010, 02:25 PM
  5. Type Mismatch: array or user defined type expected
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2006, 10:45 AM
  6. [SOLVED] Help: Compile error: type mismatch: array or user defined type expected
    By lvcha.gouqizi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2005, 05:05 PM
  7. Type mismatch error on form show
    By Darach in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-26-2005, 08:05 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