Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
744to748
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
744to748
744to748
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

Checkboxeintrag in Zelle in Abhängigkeit von Datum

Checkboxeintrag in Zelle in Abhängigkeit von Datum
22.03.2006 09:10:35
Datum
Hallo!
Ich bekam von Ingolf dankenswerterweise folgende Lösung:
Range("A1")=Userform1.Checkbox
Nach Ausführung des Codes wird in die Zelle A1 WAHR eingetragen.
Ich würde jetzt zu nachstehendem Muster folgende Lösung suchen:
Ist der 01.01.2006 aktivert und wird bei Huber3 in der Checkbox ein Hackerl gesetzt, dann soll dieses Hackerl in E4 eingetragen werden.
Ist der 02.01.2006 aktiviert und wird bei Huber8 in der Checkbox ein Hackerl gesetzt, dann soll dieses Hackerl in E19 eingetragen werden.
PS: Was gäbe es bitte noch für eine Lösung, dass statt WAHR eine 1 eingetragen wird?
https://www.herber.de/bbs/user/32118.xls

2
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Checkboxeintrag in Zelle in Abhängigkeit von Datum
22.03.2006 09:37:46
Datum
Hallo!
Mit folgender Lösung wird -1 und waagrecht eingetragen.
also wenn ich am 01.01.2006 bei Huber1,Huber2 und Huber3 ein Hackerl mache, dann wird in der Zeile von Huber1 folgendes eingetragen:
-1,-1,-1 und 7 mal ein 0
Könnte man diesen Code nach einer dementsprechenden Änderung bitte verwenden?
Wo müßte ich dann hier bitte die Änderungen vornehmen?
Danke
Josef

Private Sub CommandButton3_Click()
Dim rngFind As Range
Dim intCount As Integer, intCol As Integer, lngRow As Long
If Not IsDate(TextBox21) Then Exit Sub
With ActiveSheet
Set rngFind = .Range("B:B").Find(What:=CDate(TextBox21), LookAt:=xlWhole, LookIn:=xlFormulas)
If Not rngFind Is Nothing Then
lngRow = rngFind.Row
intCol = 5
For intCount = 1 To 10
Select Case intCount
Case 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
If Len(Trim$(Controls("CheckBox" & intCount))) > 0 Then
If IsNumeric(Controls("CheckBox" & intCount)) Then
.Cells(lngRow, intCol) = CDbl(Controls("CheckBox" & intCount))
Else
.Cells(lngRow, intCol) = Controls("CheckBox" & intCount)
End If
End If
intCol = intCol + 1
Case Else
lngRow = lngRow + 1
intCol = 5
End Select
Next
End If
Set rngFind = Nothing
End With
End Sub

Anzeige
So würde es klappen, aber....
22.03.2006 11:14:31
Josef
Hallo!
So würde es klappen.
Mein letztes Problem ist jetzt noch folgendes:
als Wert wird in die Zelle -1 eingetragen.Wie erreiche ich bitte, dass eine 1 eingetragen wird?

Private Sub CommandButton1_Click()
Dim rngFind As Range
Dim intCount As Integer, intCol As Integer, lngRow As Long
If Not IsDate(TextBox21) Then Exit Sub
With ActiveSheet
Set rngFind = .Range("B:B").Find(What:=CDate(TextBox21), LookAt:=xlWhole, LookIn:=xlFormulas)
If Not rngFind Is Nothing Then
lngRow = rngFind.Row
intCol = 5
For intCount = 1 To 19
Select Case intCount
Case 1, 3, 5, 7, 9, 11, 13, 15, 17, 19
'If Trim$(Controls("CheckBox" & intCount)) > 0 Then
If Len(Trim$(Controls("CheckBox" & intCount))) > 0 Then
If IsNumeric(Controls("CheckBox" & intCount)) Then
.Cells(lngRow, intCol) = CDbl(Controls("CheckBox" & intCount))
Else
.Cells(lngRow, intCol) = Controls("CheckBox" & intCount)
End If
End If
intCol = intCol + 1
Case Else
lngRow = lngRow + 1
intCol = 5
End Select
Next
End If
Set rngFind = Nothing
End With
End Sub

Danke
Josef
Anzeige

316 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige

Links zu Excel-Dialogen

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige