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

Hilfeee--> Dringend --> Abfrage

Hilfeee--> Dringend --> Abfrage
09.10.2002 19:07:03
Steffen
Ich brauche heute abend mal ne Gedankenstütze!

Ich habe mir folgendes Makro gebaut:


Sub Datenuebernehmen()

Set ueberzahl = ActiveCell

If Cells(ActiveCell.Row, ActiveCell.Column + 1) Then

Cells(ActiveCell.Row, ActiveCell.Column + 1).FormulaR1C1 = ueberzahl
Cells(ActiveCell.Row, ActiveCell.Column + 2).FormulaR1C1 = ueberzahl
Cells(ActiveCell.Row, ActiveCell.Column + 3).FormulaR1C1 = ueberzahl
Cells(ActiveCell.Row, ActiveCell.Column + 4).FormulaR1C1 = ueberzahl
Cells(ActiveCell.Row, ActiveCell.Column + 5).FormulaR1C1 = ueberzahl
Cells(ActiveCell.Row, ActiveCell.Column + 6).FormulaR1C1 = ueberzahl
Cells(ActiveCell.Row, ActiveCell.Column + 7).FormulaR1C1 = ueberzahl
Cells(ActiveCell.Row, ActiveCell.Column + 8).FormulaR1C1 = ueberzahl
Cells(ActiveCell.Row, ActiveCell.Column + 9).FormulaR1C1 = ueberzahl
Cells(ActiveCell.Row, ActiveCell.Column + 10).FormulaR1C1 = ueberzahl
Cells(ActiveCell.Row, ActiveCell.Column + 11).FormulaR1C1 = ueberzahl

Else
'weitere Vorgehensweise abfragen
Frage_ausfuellen.Show
End If
End Sub

Wie bekomme ich es hin, das die Werte nur ausgefüllt werden, wenn die Summe der 11 nebeneinanderliegenden Zellen 0 ist?

Ich habe es mit:

If Cells(ActiveCell.Row, ActiveCell.Column + 1) + Cells(ActiveCell.Row, ActiveCell.Column + 2) = 0....

leider geht das nicht

Vielleicht habt Ihr ne Idee

Danke schonmal

Steffen

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
Habs selber gelöst --> trotzdem Danke
09.10.2002 20:56:25
Steffen
Ich hoffe Ihr habt Euch noch nicht so viele Gedanke gemacht!

Hier meine Lösung

If Cells(ActiveCell.Row, ActiveCell.Column + 1).Value = 0 And Cells(ActiveCell.Row, ActiveCell.Column + 2).Value = 0 And Cells(ActiveCell.Row, ActiveCell.Column + 3).Value = 0 And Cells(ActiveCell.Row, ActiveCell.Column + 4).Value = 0 And Cells(ActiveCell.Row, ActiveCell.Column + 5).Value = 0 And Cells(ActiveCell.Row, ActiveCell.Column + 6).Value = 0 And Cells(ActiveCell.Row, ActiveCell.Column + 7).Value = 0 And Cells(ActiveCell.Row, ActiveCell.Column + 8).Value = 0 And Cells(ActiveCell.Row, ActiveCell.Column + 9).Value = 0 And Cells(ActiveCell.Row, ActiveCell.Column + 10).Value = 0 And Cells(ActiveCell.Row, ActiveCell.Column + 11).Value = 0 Then

Steffen

Anzeige
trotzdem noch ne Antwort
10.10.2002 05:49:20
andre
Hallo Steffen,
damit Dein If nicht so lang bleibt ein Vorschlag:

bereich = Range(Cells(ActiveCell.Row, ActiveCell.Column + 1), Cells(ActiveCell.Row, ActiveCell.Column + 11))
For Each Var In bereich
dummy = dummy + WorksheetFunction.Sum(Var)
Next
If dummy > 0 Then
'...
End If

wenn Du die Variablen dimensionieren willst oder musst dann nur
dim bereich
(nicht dim bereich(10)!)

gruss andre

Danke Dir
10.10.2002 18:57:19
Steffen
Steffen

300 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige