Ich habe eine funktion geschrieben, wie kann ich diese geschriebene funktion in vba programm aufrufen besser gesagt benutzen.
Danke Girly
Sub selectRedCells()
dim c as range
dim strAdress as string
for each c in ActiveSheet.usedRange
If c.Interior.ColorIndex = 3 then
strAdress = strAdress & c.Adress & ","
end if
next c
range(left(strAdress, Len(strAdress) - 1)).Select
End Sub
Private Sub CommandButton1_Click()
Dim c As Range
Dim strAdress As String
For Each c In ActiveSheet.UsedRange
If c.Interior.ColorIndex = 3 Then
strAdress = strAdress & Cells(c.Row, c.Column).Address & ","
End If
Next c
Range(Left(strAdress, Len(strAdress) - 1)).Select
End Sub
Sub selectRedCells()
dim c as range
dim strAdress as string
for each c in ActiveSheet.usedRange
If c.Interior.ColorIndex = 3 then
strAdress = strAdress & c.Adress & ","
end if
next c
range(left(strAdress, Len(strAdress) - 1)).Select
End Sub