Results 1 to 21 of 21

Matching values of String type

Threaded View

  1. #1
    Registered User
    Join Date
    01-05-2019
    Location
    singappre
    MS-Off Ver
    2016
    Posts
    8

    Matching values of String type

    hi guys im rather new to excel and i've been trying to create a simple user form according to this video on youtube "Data Entry Form In VBA (PART-3)"
    however, i've been getting the error "type mismatch" when i try to use application.match to match with a string value as the row i'm trying to match with is of string value.
    converting it to Long type works for values with only numbers in them, i have to match with values that are a combination of alphabets, numbers, symbols like dash and backslash.
    if i were to use the variant type how would i go about doing it?
    please advise on how to match string or variant values , thank you.

    Private Sub ComboBox1_Change()
    
    If Me.ComboBox1.Value <> "" Then
        Dim sh As Worksheet
        Set sh = ThisWorkbook.Sheets("Store") 'set sheet range, only for Store sheet'
        Dim i As String
        
        i = Application.Match((Me.ComboBox1.Value), sh.Range("A:A"), 0) 'match only with those in column A'
        
        Me.TextBox2.Value = sh.Range("B" & i).Value
        Me.TextBox3.Value = sh.Range("C" & i).Value
        Me.TextBox4.Value = sh.Range("D" & i).Value
        Me.TextBox5.Value = sh.Range("E" & i).Value
        
    End If
        
    End Sub
    Attached Images Attached Images
    Last edited by AliGW; 01-09-2019 at 01:54 AM. Reason: Irrelevant section of thread title removed.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Only text values matching using index/match lookup - data type pro
    By Stanton in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  2. Only text values matching using index/match lookup - data type pro
    By Stanton in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  3. Only text values matching using index/match lookup - data type pro
    By Stanton in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  4. Only text values matching using index/match lookup - data type pro
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 07:05 AM
  5. Only text values matching using index/match lookup - data type pro
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 AM
  6. Only text values matching using index/match lookup - data type pro
    By Stanton in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. [SOLVED] Only text values matching using index/match lookup - data type pro
    By Stanton in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  8. Only text values matching using index/match lookup - data type pro
    By Stanton in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-01-2005, 09: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