اخى الكريم الشرح موجود داخل الملف بصور توضيحيه
ماعد هذا الكود
فقط ضع هذا الكود ثم انشأ زر لتفعيله
Sub AddValidationCirclesForPrinting()
Dim DataRange As Range
Dim c As Range
Dim count As Integer
Dim o As Shape
'Set an object variable to all of the cells on the active
'sheet that have data validation -- if an error occurs, run
'the error handler and end the procedure
On Error GoTo errhandler
Set DataRange = Cells.SpecialCells(xlCellTypeAllValidation)
On Error GoTo 0
count = 0
'Loop through each cell that has data validation
For Each c In DataRange
'If the validation value for the cell is false, then draw
'a circle around the cell. Set the circle's fill to
'invisible, the line color to red and the line weight to
'1.25
If Not c.Validation.Value Then
Set o = ActiveSheet.Shapes.AddShape(msoShapeOval, _
c.Left - 2, c.Top - 2, c.Width + 4, c.Height + 4)
o.Fill.Visible = msoFalse
o.Line.ForeColor.SchemeColor = 10
o.Line.Weight = 1.25
'Change the name of the shape to InvalidData_ + count
count = count + 1
o.Name = "InvalidData_" & count
End If
Next
Exit Sub
errhandler:
MsgBox "There are no cells with data validation on this sheet."
End Sub
jتحياتى
ayman.rar