jeffcoleky
Active Member
- Joined
- May 24, 2011
- Messages
- 274
The following macro isn't working. I have it placed in the code for Sheet1. Can anyone help me understand why it won't work? it is supposed to change data certain columns to "proper" and others to upper-case.
I'd love for it to ONLY apply to UNHIDDEN rows. However, at this point having it work on ALL cells would be better than it not working at all which is where it is now...
Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim cell As Range
Application.EnableEvents = False
Select Case Sh.CodeName
Case "Sheet1"
For Each cell In Target.Cells
Select Case cell.Column
Case 2, 10, 11, 15, 21, 24, 29
cell.Value = StrConv(cell.Text, vbUpperCase)
Case 5, 6, 7, 9, 12, 13, 14, 18, 19, 20, 22, 23, 27
cell.Value = StrConv(cell.Text, vbProperCase)
End Select
Next cell
End Select
End Sub
I'd love for it to ONLY apply to UNHIDDEN rows. However, at this point having it work on ALL cells would be better than it not working at all which is where it is now...