I have a simple spreadsheet with dates in column B & E. I have two VB scripts attached to buttons that will sort the data in either of those two columns.
Any empty dates in column E would indicate a problem. If I run the script to sort by this column, I would like any cell with no data to be brought to the top in no particular order. Any other solution would work so long as it would bring attention to these blank fields. Perhaps even another script to check for empty cells in column E? I don't know much about VB scripts and got this far by the help of others on this site so thanks for your help!
Heres the script:
Private Sub CommandButton2_Click()
On Error Resume Next
Application.EnableEvents = False
Me.UsedRange.Sort _
Key1:=[B2], Order1:=xlAscending, header:=xlYes, Orientation:=xlSortColumns
Application.EnableEvents = True
On Error GoTo 0
End Sub
Private Sub CommandButton1_Click()
On Error Resume Next
Application.EnableEvents = False
Me.UsedRange.Sort _
Key1:=[E2], Order1:=xlAscending, header:=xlYes, Orientation:=xlSortColumns
Application.EnableEvents = True
On Error GoTo 0
End Sub
And heres what we're looking at:
Any ideas would be greatly appreciated.
EK
Any empty dates in column E would indicate a problem. If I run the script to sort by this column, I would like any cell with no data to be brought to the top in no particular order. Any other solution would work so long as it would bring attention to these blank fields. Perhaps even another script to check for empty cells in column E? I don't know much about VB scripts and got this far by the help of others on this site so thanks for your help!
Heres the script:
Private Sub CommandButton2_Click()
On Error Resume Next
Application.EnableEvents = False
Me.UsedRange.Sort _
Key1:=[B2], Order1:=xlAscending, header:=xlYes, Orientation:=xlSortColumns
Application.EnableEvents = True
On Error GoTo 0
End Sub
Private Sub CommandButton1_Click()
On Error Resume Next
Application.EnableEvents = False
Me.UsedRange.Sort _
Key1:=[E2], Order1:=xlAscending, header:=xlYes, Orientation:=xlSortColumns
Application.EnableEvents = True
On Error GoTo 0
End Sub
And heres what we're looking at:

Any ideas would be greatly appreciated.
EK