anovice
11-02-2010, 12:36 AM
Hi
I trawled the help sites and found this code to switch Data Input Messages on and off. I need this function depending on the experience of the user.
It works fine although it does take up to 60 secs to complete which is probably ok as there are 1000 rows and 15 columns to switch on and off.
The problem is when I try to 'Exit' or 'Save' excel crashes and closes leaving a file on the desktop A83D 1000.
Any ideas would be appreciated.
Sub InputMsgOff()
Dim ws As Worksheet
Dim rng As Range
Dim c As Range
Set ws = ActiveSheet
Set rng = ws.Cells.SpecialCells(xlCellTypeAllValidation)
For Each c In rng
On Error Resume Next
c.Validation.ShowInput = False
Next c
End Sub
Sub InputMsgOn()
Dim ws As Worksheet
Dim rng As Range
Dim c As Range
Set ws = ActiveSheet
Set rng = ws.Cells.SpecialCells(xlCellTypeAllValidation)
For Each c In rng
On Error Resume Next
c.Validation.ShowInput = True
Next c
End Sub
I trawled the help sites and found this code to switch Data Input Messages on and off. I need this function depending on the experience of the user.
It works fine although it does take up to 60 secs to complete which is probably ok as there are 1000 rows and 15 columns to switch on and off.
The problem is when I try to 'Exit' or 'Save' excel crashes and closes leaving a file on the desktop A83D 1000.
Any ideas would be appreciated.
Sub InputMsgOff()
Dim ws As Worksheet
Dim rng As Range
Dim c As Range
Set ws = ActiveSheet
Set rng = ws.Cells.SpecialCells(xlCellTypeAllValidation)
For Each c In rng
On Error Resume Next
c.Validation.ShowInput = False
Next c
End Sub
Sub InputMsgOn()
Dim ws As Worksheet
Dim rng As Range
Dim c As Range
Set ws = ActiveSheet
Set rng = ws.Cells.SpecialCells(xlCellTypeAllValidation)
For Each c In rng
On Error Resume Next
c.Validation.ShowInput = True
Next c
End Sub