Martin_H
Board Regular
- Joined
- Aug 26, 2020
- Messages
- 190
- Office Version
- 365
- Platform
- Windows
Hi team,
basically before runing my macro (see below) I want to check if there is any number in the range X4:X126.
If a number exists in the mentioned range, the macro will continue as is.
However, if there is no number in the mentioned range, I want to stop the macro and give the message "There is no number".
Thank you for your help. Much appreciated.
basically before runing my macro (see below) I want to check if there is any number in the range X4:X126.
If a number exists in the mentioned range, the macro will continue as is.
However, if there is no number in the mentioned range, I want to stop the macro and give the message "There is no number".
Thank you for your help. Much appreciated.
VBA Code:
Public Sub PRIO(ByRef control As Office.IRibbonControl)
Application.ScreenUpdating = False
Application.EnableEvents = False
With Range("X4:X126").SpecialCells(xlCellTypeBlanks)
If .EntireRow.Hidden = True Then
.EntireRow.Hidden = False
With Range("X3").Font
.Color = vbWhite: .Bold = False
End With
Application.ScreenUpdating = True
Application.EnableEvents = True
Else
.EntireRow.Hidden = True
With Range("X3").Font
.Color = vbGreen: .Bold = True
End With
Application.ScreenUpdating = True
Application.EnableEvents = True
End If
End With
End Sub