Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
1912to1916
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

TEXTKETTE in VBA

TEXTKETTE in VBA
15.01.2023 11:44:04
Fatih
Dim Strings As String
String2 = TextBoxJahr.Value
String3 = ComboBoxKW.Value
String4 = IIf(OptionButtonMontag.Value = True, DateSerial(Year(Date), 1, (ComboBoxKW.Value - 1) * 7 + 2), IIf(OptionButtonDienstag.Value = True, DateSerial(Year(Date), 1, (ComboBoxKW.Value - 1) * 7 + 3), IIf(OptionButtonMittwoch.Value = True, DateSerial(Year(Date), 1, (ComboBoxKW.Value - 1) * 7 + 4), IIf(OptionButtonDonnerstag.Value = True, DateSerial(Year(Date), 1, (ComboBoxKW.Value - 1) * 7 + 5), IIf(OptionButtonFreitag.Value = True, DateSerial(Year(Date), 1, (ComboBoxKW.Value - 1) * 7 + 6), IIf(OptionButtonSamstag.Value = True, DateSerial(Year(Date), 1, (ComboBoxKW.Value - 1) * 7 + 7), IIf(OptionButtonSonntag.Value = True, DateSerial(Year(Date), 1, (ComboBoxKW.Value - 1) * 7 + 8), "")))))))
String50 = IIf(OptionButtonBE.Value = True, "BE", IIf(OptionButtonBüyükGencler.Value = True, "BG", IIf(OptionButtonKG.Value = True, "KG", IIf(OptionButtonCO.Value = True, "CO", ""))))
String6 = IIf(OptionButton1Unterricht.Value = True, "1", IIf(OptionButton2Unterricht.Value = True, "2", IIf(OptionButton3Unterricht.Value = True, "3", IIf(OptionButton4Unterricht.Value = True, "4", IIf(OptionButton5Unterricht.Value = True, "5", IIf(OptionButton6Unterricht.Value = True, "6", IIf(OptionButton7Unterricht.Value = True, "7", "")))))))
'Textkette
TextBoxID.Value = Concat(String2 & String3 & String4 & String50 & String6)
Dies ist die Formel ('Textkette) was ich eingegeben habe, wobei es nicht geklappt hat. Wie kann ich das Problem lösen?

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: TEXTKETTE in VBA
15.01.2023 12:02:01
RPP63
Moin!
1. Concat ist eine WorksheetFunction!
2. Wenn Du Option Explicit in den Modulkopf setzt, fliegt Dir das Makro um die Ohren!
Aber egal:
Entweder kommagetrennt:

WorksheetFunction.Concat("a","B")
oder mit Verkettungsoperator &:

"a" & "B"
Gruß Ralf
Anzeige

300 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige

Links zu Excel-Dialogen

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige