Private Sub Worksheet_Change(ByVal Target As Range)
Dim rangeCurrentCell As Range
Dim rangeSelected As Range
If Not Intersect(ActiveCell, Range(„rangeGroupsAndCriteria“)) Is Nothing Then
ReplaceEmptyCellWithOneBlank Target
End Sub
Private Sub ReplaceEmptyCellWithOneBlank(rangeArea As Range)
Dim rangeCell As Excel.Range
Dim sContent As String
Dim bMsgDisplayed As Boolean
For Each rangeCell In rangeArea.Cells
sContent = rangeCell.Value
Select Case sContent
Case IsNumeric
Case „“
With Application
.EnableEvents = False
End With
rangeCell.Value = " "
With Application
.EnableEvents = False
End With
Case Else
End Select
Next rangeCell
End Sub
Der Prozeduraufruf:
ReplaceEmptyCellWithOneBlank (Target)
führt zum Fehler „Objekt erforderlich“
Wie kann ich Target als Range an die Prozedur übergeben?