Andreas Hermle
asked on
Search for Cells with a question mark and shade them
Dear Experts:
I would like to do achieve the following with the aid of a VBA macro:
Search for cells on the active worksheet that contain a QUESTION MARK and fill those cells with a RGB fill (RGB 191, 191, 191) .
The number of cells found and shaded should be displayed in a MsgBox.
Help is much appreciated. Thank you very much in advance.
Regards, Andreas
I would like to do achieve the following with the aid of a VBA macro:
Search for cells on the active worksheet that contain a QUESTION MARK and fill those cells with a RGB fill (RGB 191, 191, 191) .
The number of cells found and shaded should be displayed in a MsgBox.
Help is much appreciated. Thank you very much in advance.
Regards, Andreas
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ah, I forgot about the msgbox. Solution of wchh is the correct one.
Sub ShdCntLst()
dim R as range
dim lst as string
dim i as integer
For Each RIn ActiveSheet.UsedRange.Cell s
If R.Value Like "*[?]*" Then
R.Interior.Color = RGB(191, 191, 191)
lst = lst & " : " & R.adress
i=i+1
End If
Next
MSGBOX ("found " & i & "Question markes in the following cells : " & lst)
end if
dim R as range
dim lst as string
dim i as integer
For Each RIn ActiveSheet.UsedRange.Cell
If R.Value Like "*[?]*" Then
R.Interior.Color = RGB(191, 191, 191)
lst = lst & " : " & R.adress
i=i+1
End If
Next
MSGBOX ("found " & i & "Question markes in the following cells : " & lst)
end if
last end if should have been end sub
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dear all,
great job from all of you. It is always hard to distribute the points equitably. I really appreciate your professionalism. This forum deserves its name.
Thank you very much . Regards, Andreas
great job from all of you. It is always hard to distribute the points equitably. I really appreciate your professionalism. This forum deserves its name.
Thank you very much . Regards, Andreas
Open in new window