Bitte um Hilfe
26.04.2005 17:59:32
artuk
habe hier eine Tabelle, die wesentlich durch dieses Makro beeinflusst wird.
https://www.herber.de/bbs/user/21738.xls
Option Explicit
Sub Neu11()
Dim Anz%, TB, I%, LR, FR%
Set TB = Sheets("Seminarbeurteilung")
FR = 4 'Anzahl Fragen (kannst du ggf anpassen / wird im Folgenden Code dann automatisch erweitert)
LR = TB.Cells(Rows.Count, 1).End(xlUp).Row 'ermittelt letzte Zeile der Spalte A
LR = LR + 3
TB.Cells(LR, 1).Value = "Seminar"
TB.Cells(LR, 2).Value = "..."
'Gültigkeit1
With TB.Cells(LR, 2).Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=Seminare"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
LR = LR + 1
TB.Cells(LR, 1).Value = "Trainer"
TB.Cells(LR, 2).Value = "..."
'Gültigkeit2
With TB.Cells(LR, 2).Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=Trainer"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
LR = LR + 1
TB.Cells(LR, 1).Value = "Datum"
LR = LR + 2
'Fragen
For I = 1 To FR
TB.Cells(LR, I + 1).Value = "Frage" & I
Next
LR = LR + 2
'Abfrage Teilnehmer
Anz = InputBox("Geben Sie bitte die Anzahl der TN ein:", "Neues Seminar")
If Anz > 0 Then
'Teilnehmer einfügen
For I = 1 To Anz
TB.Cells(LR, 1).Value = "TN" & I
LR = LR + 1
Next
'Summen
TB.Range(Cells(LR, 2), Cells(LR, FR + 1)).FormulaR1C1 = "=SUM(R[-" & Anz & "]C:R[-1]C)"
TB.Cells(LR, 1).Value = "Summe"
LR = LR + 1
'Anzahl..
TB.Range(Cells(LR, 2), Cells(LR, FR + 1)).FormulaR1C1 = "=R[-1]C/COUNT(R[-" & Anz + 1 & "]C:R[-2]C)"
TB.Cells(LR, 1).Value = " Ø "
LR = LR + 2
'Mittelwert
TB.Cells(LR, 2).FormulaR1C1 = "=SUM(R[-2]C:R[-2]C[" & FR - 1 & "])/" & FR
TB.Cells(LR, 1).Value = "Gesamt Ø"
End If
End Sub
Jetzt möchte ich, dass die Felder Trainer und Seminar blinken,solange die Felder daneben nicht ausgefüllt sind.
Geht das?
MFG
artuk