Consulting

Results 1 to 4 of 4

Thread: Modify macro to output to Combobox

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Modify macro to output to Combobox

    I have a macro that searches a textbox for diseases listed in a range (acty sheet column A). Is there a way I can output the results to 1) combo box, 2) listbox, or 3) on the existing sheet. I want three different examples so I know how to deal with them in the future. Attached is the representative sample. Hope someone can help me.

    Public Sub T()
      Dim sSentence As String
      Dim s As Variant
      Dim sDict As Variant
      Dim last As Long
    
      last = Sheets("Acty").Range("A65536").End(xlUp).Row
      
      sDict = Sheets("Acty").Range("A1:A" & last)
    
      sSentence = Sheets("GUI").TextBox1
      
      For Each s In sDict
        If InStr(1, sSentence, Trim$(s), VbCompareMethod.vbTextCompare) > 0 Then
          MsgBox s
        Else
      
        End If
      Next
    
    End Sub
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •