Betrifft: Laufzeitfehler 1004: Anwendungs- oder objektorient
von: Stefan
Private Sub cmdÄndern_Click() 'Daten Eingaben Ändern
Call sndPlaySound32("C:\Vereinsordner\Media\Windows Navigation Start.wav", 1)
ActiveSheet.Unprotect "Havel59" '
If TextBox2 = "" Then '
MsgBox "Es wurden keine Daten ausgewählt !", _
vbInformation, " Hinweis für " & Application.UserName
Exit Sub 'Wenn Dann Beenden
End If 'Wenn Dann Ende
Application.ScreenUpdating = False '
Cells(i, 5) = ComboBox1 'E Anrede
Cells(i, 6) = TextBox2 'F Name
Cells(i, 7) = TextBox3 'G Vorname
Cells(i, 8) = TextBox4 'H Straße
Cells(i, 9) = TextBox5 'I PLZ
Cells(i, 10) = TextBox6 'J Ort
Cells(i, 11) = TextBox7 'K Geb.
Cells(i, 12) = TextBox8 'L Alter
Cells(i, 13) = TextBox9 'M KAVO
Cells(i, 14) = ComboBox3 'N Status
Cells(i, 15) = TextBox22 'O Eintritt
Cells(i, 16) = TextBox25 'P Jup.
Cells(i, 17) = TextBox24 'Q Austritt
Cells(i, 18) = TextBox17 'R Land
Cells(i, 19) = TextBox18 'S Telefon
Cells(i, 20) = TextBox16 'T Handy
Cells(i, 21) = TextBox19 'U Fax
Cells(i, 22) = TextBox20 'V EMail
Cells(i, 23) = TextBox23 'W Liegeplatz
Cells(i, 24) = TextBox11 'X 1. Datum
Cells(i, 25) = ComboBox4 'Y 1. Auszeichnung
Cells(i, 26) = TextBox26 'Z 2. Datum
Cells(i, 27) = ComboBox5 'AA 2. Auszeichnung
Cells(i, 28) = TextBox27 'AB 3. Datum
Cells(i, 29) = ComboBox6 'AC 3. Auszeichnung
Cells(i, 30) = TextBox28 'AD 4. Datum
Cells(i, 31) = ComboBox7 'AE 4. Auszeichnung
Cells(i, 32) = TextBox29 'AF 5. Datum
Cells(i, 33) = ComboBox8 'AG 5. Auszeichnung
Cells(i, 34) = TextBox30 'AH 6. Datum
Cells(i, 35) = ComboBox9 'AI 6. Auszeichnung
Cells(i, 36) = TextBox31 'AJ Bemerkung
Cells(i, 37) = Label92 'AK Letzte Aktualisierung
Cells(i, 38) = ComboBox2 'AL Geschlecht
Range("E3:AL1003").Columns.AutoFit 'Spaltenbreite Automatik
Dim z%, r%, s%, sj% '
z = Range("F1003").End(xlUp).Row '
For r = 4 To z '
sj = 0 '
For s = Format(Cells(r, 1), "yyyy") To Format(Now(), "yyyy") '
If s Mod 4 = 0 Then '
sj = sj + 1 '
End If '
Next s '
Cells(r, 12) = Int((DateDiff("d", Format(Cells(r, 11), "DD.MM.YYYY"), Now) - sj) / 365) '
Cells(r, 16) = Int((DateDiff("d", Format(Cells(r, 15), "DD.MM.YYYY"), Now) - sj) / 365) '
Next r '
If TextBox7 = "" Then '
Cells(i, 12) = "" '
End If
If TextBox9 = "" Then '
Cells(i, 13) = "" '
End If 'Wenn Dann Ende
Call ProgressBar4
Label84.BackColor = RGB(122, 255, 100) 'grün
Label84.ForeColor = RGB(0, 0, 0) 'schwarz
Label84.Caption = "Datensatz wurde geändert !"
Application.Wait (Now + TimeValue("00:00:03"))
Label84.BackColor = &HFF0000 'blau
Label84.ForeColor = &HFFFF& 'gelb
Label84.Caption = "Mitgliederverwaltung Managerment System"
cmdSpeichern.Enabled = True
End Sub
'Makro Ende
Betrifft: und in welcher Codezeile denn? o.w.T.
von: 1713669.html
Geschrieben am: 18.09.2019 14:40:10
Betrifft: AW: und in welcher Codezeile denn? o.w.T.
von: 1713674.html
Geschrieben am: 18.09.2019 14:47:14
Hallo Werner,
entschuldige, alle Cells(......)=......
er zeigt einen nach dem anderen an aber nur die !
gruß stefan
Betrifft: AW: und in welcher Codezeile denn? o.w.T.
von: 1713675.html
Geschrieben am: 18.09.2019 14:51:26
Hallo Stefan,
keine deiner Variablen ist Dim(ensioniert), ganz schlecht.
Dann verwendest du eine Variable i, weist ihr aber (zumindest im hier gezeigten Code) keinen Wert zu. Bedeutet i = 0, und eine Zeile 0 gibt es in Excel nicht.
Cells(i, 5) = ComboBox1
Gruß Werner
Betrifft: AW: Kleine Gedanken Hilfe von Euch bitte
von: 1713786.html
Betrifft: AW: Kleine Gedanken Hilfe von Euch bitte
von: 1713826.html
Private Sub cmdÄndern_Click()
Dim i As Long, z As Long, r As Long, s As Long, sj As Long
z = Range("F1003").End(xlUp).Row
Call sndPlaySound32("C:\Vereinsordner\Media\Windows Navigation Start.wav", 1)
ActiveSheet.Unprotect "Havel59"
If TextBox2 = "" Then
MsgBox "Es wurden keine Daten ausgewählt !", _
vbInformation, " Hinweis für " & Application.UserName
Exit Sub
End If
Application.ScreenUpdating = False
Cells(i, 5) = ComboBox1
Cells(i, 6) = TextBox2
Cells(i, 7) = TextBox3
Cells(i, 8) = TextBox4
Cells(i, 9) = TextBox5
Cells(i, 10) = TextBox6
Cells(i, 11) = TextBox7
Cells(i, 12) = TextBox8
Cells(i, 13) = TextBox9
Cells(i, 14) = ComboBox3
Cells(i, 15) = TextBox22
Cells(i, 16) = TextBox25
Cells(i, 17) = TextBox24
Cells(i, 18) = TextBox17
Cells(i, 19) = TextBox18
Cells(i, 20) = TextBox16
Cells(i, 21) = TextBox19
Cells(i, 22) = TextBox20
Cells(i, 23) = TextBox23
Cells(i, 24) = TextBox11
Cells(i, 25) = ComboBox4
Cells(i, 26) = TextBox26
Cells(i, 27) = ComboBox5
Cells(i, 28) = TextBox27
Cells(i, 29) = ComboBox6
Cells(i, 30) = TextBox28
Cells(i, 31) = ComboBox7
Cells(i, 32) = TextBox29
Cells(i, 33) = ComboBox8
Cells(i, 34) = TextBox30
Cells(i, 35) = ComboBox9
Cells(i, 36) = TextBox31
Cells(i, 37) = Label92
Cells(i, 38) = ComboBox2
Range("E3:AL1003").Columns.AutoFit
For r = 4 To z
sj = 0
For s = Format(Cells(r, 1), "yyyy") To Format(Now(), "yyyy")
If s Mod 4 = 0 Then
sj = sj + 1
End If
Next s
Cells(r, 12) = Int((DateDiff("d", Format(Cells(r, 11), "DD.MM.YYYY"), Now) - sj) / 365)
Cells(r, 16) = Int((DateDiff("d", Format(Cells(r, 15), "DD.MM.YYYY"), Now) - sj) / 365)
Next r
If TextBox7 = "" Then
Cells(i, 12) = ""
End If
If TextBox9 = "" Then
Cells(i, 13) = ""
End If
Call ProgressBar4
Label84.BackColor = RGB(122, 255, 100)
Label84.ForeColor = RGB(0, 0, 0)
Label84.Caption = "Datensatz wurde geändert !"
Application.Wait (Now + TimeValue("00:00:03"))
Label84.BackColor = &HFF0000
Label84.ForeColor = &HFFFF&
Label84.Caption = "Mitgliederverwaltung Managerment System"
cmdSpeichern.Enabled = True
End Sub
Noch mal:
Betrifft: AW: Hallo Werner, letzer Beitrag, dann zu u. Danke
von: 1713876.html
Private Sub cmdÄndern_Click()
If TextBox2 = "" Then MsgBox "Es wurden keine Daten ausgewählt !", _ vbInformation, " Hinweis fü _
r " & Application.UserName
Exit Sub
End If
Application.ScreenUpdating = False
Cells(i, 5) = ComboBox1 'Quasi durch die vorherige Suche gefundene Zeile (i) und Spalte 5 (E) _
jetzt mit Textbox Inhalten ersetzen
Cells(i, 6) = TextBox2
Cells(i, 7) = TextBox3
Cells(i, 8) = TextBox4
Cells(i, 9) = TextBox5
Cells(i, 10) = TextBox6
Cells(i, 11) = TextBox7
Cells(i, 12) = TextBox8
Cells(i, 13) = TextBox9
Cells(i, 14) = ComboBox3
Cells(i, 15) = TextBox22
Cells(i, 16) = TextBox25
Cells(i, 17) = TextBox24
Cells(i, 18) = TextBox17
Cells(i, 19) = TextBox18
Cells(i, 20) = TextBox16
Cells(i, 21) = TextBox19
Cells(i, 22) = TextBox20
Cells(i, 23) = TextBox23
Cells(i, 24) = TextBox11
Cells(i, 25) = ComboBox4
Cells(i, 26) = TextBox26
Cells(i, 27) = ComboBox5
Cells(i, 28) = TextBox27
Cells(i, 29) = ComboBox6
Cells(i, 30) = TextBox28
Cells(i, 31) = ComboBox7
Cells(i, 32) = TextBox29
Cells(i, 33) = ComboBox8
Cells(i, 34) = TextBox30
Cells(i, 35) = ComboBox9
Cells(i, 36) = TextBox31
Cells(i, 37) = Label92
Cells(i, 38) = ComboBox2
Range("E3:AL1003").Columns.AutoFit
End Sub
MfG Stefan
Betrifft: AW: Hallo Werner, letzer Beitrag, dann zu u. Danke
von: 1713877.html
Betrifft: AW: Hi Werner, Probl. gelöst, Liste läuft wieder
von: 1714204.html
Geschrieben am: 21.09.2019 14:08:25
Hallo Werner,
Habe ein Modul mit Global i As Integer angelegt und Liste läuft wieder rund.
Besten Dank dir für deine Bemühungen.
Gibt schon wieder neue Probleme HaHa.
Beste Grüße Stefan
Betrifft: Passwort geändert?
von: 1713679.html
Geschrieben am: 18.09.2019 14:54:26
Gruß Daniel
Betrifft: dann würde ja ...
von: 1713745.html
Geschrieben am: 18.09.2019 19:28:12
Hallo Daniel,
... eine Meldung kommen, dass das PW falsch ist.
Gruß
Rudi
Excel-Beispiele zum Thema "Laufzeitfehler 1004: Anwendungs- oder objektorient" | |
---|---|
Fortlaufende Suche unter Vermeidung eines Laufzeitfehlers |