I've written a macro so that a user can select cells and then convert any text within the cells to upper case. If I close out of the macro editor instead of saving, I notice the macro runs perfectly. BUT, my problem is anytime I try to save the workbook the program hard crashes and restores itself without any of the macros I've written for it.
Here is the macro...any ideas as to why this would cause Excel to bomb. I'm saving as Microsoft Excel 97-2002 & 5.0/95 Workbook.
Sub UpperCase()
Dim cell As Range
'Ask if the user has the correct range selected
Response = MsgBox("Have you selected the cell to convert to Upper Case?", vbYesNo, "Convert to Upper Case")
If Response = vbNo Then ' User chose No.
End
Else ' User chose No.
End If
For Each cell In Selection.Cells
If cell.HasFormula = False Then ' Do not convert case if cell has a formula
cell = UCase(cell) ' Force upper case
End If
Next
End Sub
Thanks for any help.
Here is the macro...any ideas as to why this would cause Excel to bomb. I'm saving as Microsoft Excel 97-2002 & 5.0/95 Workbook.
Sub UpperCase()
Dim cell As Range
'Ask if the user has the correct range selected
Response = MsgBox("Have you selected the cell to convert to Upper Case?", vbYesNo, "Convert to Upper Case")
If Response = vbNo Then ' User chose No.
End
Else ' User chose No.
End If
For Each cell In Selection.Cells
If cell.HasFormula = False Then ' Do not convert case if cell has a formula
cell = UCase(cell) ' Force upper case
End If
Next
End Sub
Thanks for any help.