Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'Sheets(KategoriComboBox.Text).Activate
- ' https://analystcave.com/excel-vba-listbox/
- Private Sub UserForm_Activate()
- 'Add all available sheet names to dropdown box
- For Each wksCurrentSheet In Worksheets
- ComboBox1.AddItem wksCurrentSheet.Name
- Next wksCurrentSheet
- ComboBox1.Text = Sheets(3).Name
- 'Sheets("<sheet Name>").Index
- 'Sheets("<sheet Name>").CodeName
- 'ComboBox2.List = Range("A1:C5").Value
- For Each head In Range("a1:c1")
- ComboBox2.AddItem head.Value
- Next head
- End Sub
- Private Sub ComboBox1_Change()
- Sheets(ComboBox1.Text).Activate
- End Sub
- Private Sub UserForm_Terminate()
- Selection.AutoFilter Field:=Sheets("Munka3").Index
- End Sub
- Private Sub TextBox1_Change()
- 'Selection.AutoFilter Field:=Sheets(ComboBox2.Text).Index, Criteria1:=TextBox1.Text
- Selection.AutoFilter Field:=Sheets("Munka3").Index, Criteria1:=TextBox1.Text
- End Sub
- Sub RemoveCarriageReturns()
- Dim MyRange As Range
- Application.ScreenUpdating = False
- Application.Calculation = xlCalculationManual
- For Each MyRange In ActiveSheet.UsedRange
- Debug.Print MyRange.Address
- If 0 < InStr(MyRange, Chr(10) & Chr(10)) Then
- MyRange = Replace(MyRange, Chr(10) & Chr(10), "")
- Debug.Print "k"
- End If
- If Len(MyRange.Value) = InStr(MyRange, Chr(10)) Then
- MyRange = Replace(MyRange, Chr(10), "")
- Debug.Print "v"
- End If
- Next
- Application.ScreenUpdating = True
- Application.Calculation = xlCalculationAutomatic
- End Sub
- Private Sub ComboBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
- ComboBox1.RowSource = "Munka1!a1:c3"
- Selection.AutoFilter Field:=1, Criteria1:=ComboBox1.Text
- End Sub
- Private Sub CommandButton1_Click()
- 'Label1.Caption = ComboBox1.SelText
- TextBox1.Text = TextBox1.Text & vbNewLine & ComboBox1.Text
- End Sub
- Private Sub TextBox1_Change()
- Range("d5").Value = TextBox1.Value
- End Sub
- Private Sub UserForm_Initialize()
- ComboBox1.Clear
- TextBox1.MultiLine = True
- End Sub
Add Comment
Please, Sign In to add comment