Live-Forum - Die aktuellen Beiträge
Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Hilfeee--> Dringend --> Abfrage

Forumthread: 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

Anzeige

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

Anzeige
Danke Dir
10.10.2002 18:57:19
Steffen
Steffen
;

Forumthreads zu verwandten Themen

Anzeige
Anzeige
Anzeige
Entdecke relevante Threads

Schau dir verwandte Threads basierend auf dem aktuellen Thema an

Alle relevanten Threads mit Inhaltsvorschau entdecken

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Entdecke mehr
Finde genau, was du suchst

Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden

Suche nach den besten Antworten
Unsere beliebtesten Threads

Entdecke unsere meistgeklickten Beiträge in der Google Suche

Top 100 Threads jetzt ansehen
Anzeige