Because I'm lazy & want consistency in data input, I wrote the following macro to convert text to upper case in three cells on a worksheet:
Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Value <> "" And Target = [b5] Then
Target.Value = UCase(Target.Value)
End If
If Target.Value <> "" And Target = [b6] Then
Target.Value = UCase(Target.Value)
End If
If Target.Value <> "" And Target = [b7] Then
Target.Value = UCase(Target.Value)
End If
End Sub
it might be a bit clumsy but it worked without any errors.
However, I've been migrated to Excel2010 and now the macro appears to get into a loop, asks me to "End" or "Debug" the macro & my only recourse is to save the spreadsheet, shut excel down through Task Manager and re-open Excel.
Does anyone have any clues/suggestions, please?
Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Value <> "" And Target = [b5] Then
Target.Value = UCase(Target.Value)
End If
If Target.Value <> "" And Target = [b6] Then
Target.Value = UCase(Target.Value)
End If
If Target.Value <> "" And Target = [b7] Then
Target.Value = UCase(Target.Value)
End If
End Sub
it might be a bit clumsy but it worked without any errors.
However, I've been migrated to Excel2010 and now the macro appears to get into a loop, asks me to "End" or "Debug" the macro & my only recourse is to save the spreadsheet, shut excel down through Task Manager and re-open Excel.
Does anyone have any clues/suggestions, please?