• Ask a Question
150
Insert Image Size must be less than < 5MB.
    Ask a Question
    Cancel
    150
    More answer You can create 5 answer(s).
      Ask a Poll
      Cancel
      Participant

      i got a error as type mismatch

       

      hi

      i need to get a value from the excel which has integer value by selecting a text From cell Range “A” (by selecting a Cell “A” need to get a particular value of cell “B”)

      i don’t know where i made a mistake pls help me out

       

       

      Private Sub ComboBox1_Change()
      Dim i As Long, LastRow As Long
      LastRow = Sheets(“sheet1”).Range(“A” & Rows.Count).End(xlUp).Rows
      For i = 2 To LastRow
      If Sheets(“sheet1”).Cells(i, “A”).Value = (Me.ComboBox1) Or Sheets(“sheet1”).Cells(i, “A”).Value = Val(Me.ComboBox1) Then
      Me.TextBox2 = Sheets(“sheet1”).Cells(i, “B”).Value
      End If
      Next
      End Sub

      Private Sub ComboBox1_dropbuttonClick()
      Dim i As Long, LastRow As Long
      LastRow = Sheets(“sheet1”).Range(“B” & Rows.Count).End(xlUp).row
      If Me.ComboBox1.ListCount = 0 Then
      For i = 2 To LastRow
      Me.ComboBox1.AddItem Sheets(“sheet1”).Cells(i, “A”).Value
      Next i
      End If
      End Sub

      Asked by kanch90 on February 18, 2018 in VBA: User Forms.
      0 Answers