Informationen und Beispiele zum Thema CheckBox | |
---|---|
![]() |
CheckBox-Seite mit Beispielarbeitsmappe aufrufen |
Informationen und Beispiele zum Thema MsgBox | |
---|---|
![]() |
MsgBox-Seite mit Beispielarbeitsmappe aufrufen |
Informationen und Beispiele zum Thema CommandButton | |
---|---|
![]() |
CommandButton-Seite mit Beispielarbeitsmappe aufrufen |
Informationen und Beispiele zum Thema TextBox | |
---|---|
![]() |
TextBox-Seite mit Beispielarbeitsmappe aufrufen |
Betrifft: Kalenderwoche = #WERT
von: Heinz H
Geschrieben am: 29.01.2010 19:26:31
Hallo Leute
Habe in einer UF eine Combobox1.
Die mir in Sheet F1 das Datum eingibt.
In F1 habe ich die Formel
=KÜRZEN((E6-WOCHENTAG(E6;2)-DATUM(JAHR(E6+4-WOCHENTAG(E6;2));1;-10))/7)&" KW"
.Range("F1").Value = Mid(Me.ComboBox1, 5) 'Zelle F1 Für Kalenderwoche
Betrifft: AW: Kalenderwoche = #WERT
von: Hajo_Zi
Geschrieben am: 29.01.2010 19:32:59
Hallo Heinz,
Du schreibst Text in die Zelle und keine Zahl (Datum)
cdate( Mid(Me.ComboBox1, 5))
Betrifft: AW: Kalenderwoche = #WERT
von: Heinz H
Geschrieben am: 29.01.2010 19:49:22
Hallo Hajo
Jetzt bekomme ich in F1 "40187KW"
Gruß
Heinz
Betrifft: AW: Kalenderwoche = #WERT
von: Hajo_Zi
Geschrieben am: 29.01.2010 19:50:35
Hallo Heinz,
nur wenige sehen Deine Datei. Ich sehe Sie nicht.
Gruß Hajo
Betrifft: AW: Kalenderwoche = #WERT
von: Heinz H
Geschrieben am: 29.01.2010 19:56:29
Hallo Hajo
Die Datei ist sehr Umfangreich.
Ich hoffe es ist das richtige Makro.
Heinz
Private Sub UserForm_Activate() Dim i As Long Dim rngReadIn As Range, rngCell As Range Set rngReadIn = Sheets("Umbauplan").Range("A4:A11,A15:A21") For Each rngCell In rngReadIn With Me.ComboBox1 .AddItem Format(rngCell, "DDD.DD.MMM.YYYY") .List(.ListCount - 1, 1) = rngCell.Row End With Next Me.ComboBox1.Value = Format(Date, "DDD.DD.MMM.YYYY") ComboBox1.SetFocus Call namen_eintragen Dim lastRow As Long With Sheets("Speicherung") .Unprotect Password:="vetro" lastRow = .Cells(.Rows.Count, 1).End(xlUp).Row If (.Cells(lastRow + 1, 2) = "") Then Me.TextBox100.Value = .Cells(lastRow, 2) Else Me.TextBox100.Value = .Cells(lastRow + 1, 2) End If .Protect Password:="test" End With End Sub
Betrifft: AW: Kalenderwoche = #WERT
von: Hajo_Zi
Geschrieben am: 29.01.2010 20:00:31
Hallo Heinz
ich kann damit Leben, ich habe nicht das Problem.
Deine Formel zum ermitteln der KJalenderwoche greift auf E6 zu Dein anderer Code schreibt aber was in F..
Gruß Hajo
Betrifft: AW: Kalenderwoche = #WERT
von: Heinz H
Geschrieben am: 29.01.2010 20:16:02
Hallo Hajo
Das ist nun der Code zum einfügen & ausdrucken.
In E6 wird das Datum eingetragen. In F1 sollte nun die KW rauskommen.
Danke & Gruß
Heinz
'--------------Neu Wochenumbau W311 Private Sub CommandButton6_Click() Application.ActivePrinter = "NRG MP 2510 PCL 5e auf Ne01:" Application.ScreenUpdating = False Dim wksMaschine As Worksheet, bolDrucken As Boolean If Not Me.CheckBox10 And Not Me.CheckBox11 And Not Me.CheckBox12 And Not Me.CheckBox13 And Not _ Me.CheckBox14 And Not Me.CheckBox15 And Not Me.CheckBox16 Then MsgBox "Kein Linie ausgewählt!" Exit Sub End If If Me.ComboBox1.ListIndex = -1 Then MsgBox "Bitte Datum wählen!" Exit Sub End If Set wksMaschine = Worksheets("W311") Application.ScreenUpdating = False If Me.ComboBox1.ListIndex = -1 Then MsgBox "Bitte Datum wählen!" End If Worksheets("W311").Unprotect Password:="vetro" Worksheets("W311").Visible = True With wksMaschine .Range("E6").Value = Mid(Me.ComboBox1, 5) 'Zelle E6 ist als Datum korrekt formatiert .Range("F1").Value = CDate(Mid(Me.ComboBox1, 5)) 'Zelle F1 Für Kalenderwoche .Range("E4") = "Artikel Bez.: " & Me.TextBox2 'Artikelbeschreibung .Range("A4") = "Art. Nr.: " & Me.TextBox3 'ArtikelNummer .Range("I4") = "Mündung: " & Me.TextBox4 'Mündung If CheckBox11 = True Then Worksheets("W311").PrintOut End If End With
Betrifft: AW: Kalenderwoche = #WERT
von: Josef Ehrensberger
Geschrieben am: 29.01.2010 20:17:07
Hallo Heinz,
probier mal
Clng(Mid(Me.ComboBox1, 5))
Betrifft: AW: Kalenderwoche = #WERT
von: Heinz H
Geschrieben am: 29.01.2010 20:27:58
Hallo Josef
Bekomme den Fehler "Typen unverträglich Fehler 13"
Aber es zeigt in E6 6.Jän.2010 -- und in F1 KW1 an.
Gruß
Heinz
Betrifft: AW: Kalenderwoche = #WERT
von: Josef Ehrensberger
Geschrieben am: 29.01.2010 20:29:43
Hallo Heinz,
was steht den in Combobox5?
Betrifft: AW: Kalenderwoche = #WERT
von: Heinz H
Geschrieben am: 29.01.2010 20:35:14
Hallo Josef
was steht den in Combobox5?Gibt es nicht
Betrifft: sorry, meinte natürlich ComboBox1. o.T.
von: Josef Ehrensberger
Geschrieben am: 29.01.2010 20:37:39
Betrifft: AW: sorry, meinte natürlich ComboBox1. o.T.
von: Heinz H
Geschrieben am: 29.01.2010 20:40:35
Hallo Josef
Private Sub ComboBox1_Change() Dim Zeile As Long, SAP_Nr As Variant, ZelleArtikel As Range Dim wksArtikel As Worksheet, wksUmbau As Worksheet Dim SpalteMaschine As Long Set wksUmbau = Worksheets("Umbauplan") Set wksArtikel = Worksheets("Artikeln") '-------311 SpalteMaschine = 3 'Spalte mit den SAP-Nummern für Maschine 311 im Blatt Umbauplan If Me.ComboBox1.ListIndex <> -1 Then With Me.ComboBox1 SAP_Nr = wksUmbau.Cells(.List(.ListIndex, 1), SpalteMaschine) End With With wksArtikel 'SAP-Nummer in Spalte A (1) suchen Set ZelleArtikel = .Columns.Find(What:=SAP_Nr, LookIn:=xlValues, LookAt:=xlWhole) If ZelleArtikel Is Nothing Then MsgBox "SAP_Nr " & SAP_Nr & " nicht gefunden!" Else Zeile = ZelleArtikel.Row Me.TextBox1 = SAP_Nr Me.TextBox2 = .Cells(Zeile, 3).Text 'Artikelbeschreibung Me.TextBox3 = .Cells(Zeile, 2).Text 'ArtikelNummer Me.TextBox4 = .Cells(Zeile, 4).Text 'Mündung Me.TextBox5 = .Cells(Zeile, 5).Text 'Farbe ' Me.TextBox6 = .Cells(Zeile, 99).Text '+ Spalte ??? ' Me.TextBox7 = .Cells(Zeile, 99).Text '- Spalte ??? ' Me.TextBox8 = .Cells(Zeile, 99).Text 'Gewicht Spalte ??? End If End With
Betrifft: Was steht in ComboBox1?
von: Josef Ehrensberger
Geschrieben am: 29.01.2010 20:43:39
Hallo Heinz,
mich interessiert nicht der Code, sondern was in der Combo steht!
Betrifft: AW: Was steht in ComboBox1?
von: Heinz H
Geschrieben am: 29.01.2010 20:49:30
Josef
Jetzt verstehe ich nur Bahnhof !!
mich interessiert nicht der Code, sondern was in der Combo steht!Heinz
Betrifft: AW: Was steht in ComboBox1?
von: Josef Ehrensberger
Geschrieben am: 29.01.2010 20:50:51
Hallo Heinz,
ich will wissen, was in der ComboBox1 steht, also den Text den man sieht.
Was ist daran nicht zu verstehen?
Betrifft: AW: Was steht in ComboBox1?
von: Heinz H
Geschrieben am: 29.01.2010 21:08:38
Hallo Josef
Beim öffnen der UF steht in der Combo1 immer das Datum von heute.
Fr.29.Jän.2010
Gruß
Heinz
Betrifft: AW: Was steht in ComboBox1?
von: Josef Ehrensberger
Geschrieben am: 29.01.2010 21:10:56
Hallo Heinz,
was soll dann "Mid(ComboBox1, 5)" ?
CDate(Mid(ComboBox1,4,10))
Betrifft: AW: Was steht in ComboBox1?
von: Heinz H
Geschrieben am: 29.01.2010 21:17:08
Hallo Josef
Du bist ein kleiner Gott.
Das war eine schwere Geburt, meinerseits.
Wünsche ein schönes Wochenende.
Gruß
Heinz