Я в тупике - этот код работал нормально - теперь он работает в неправильных столбцах.Возьмем, к примеру, столбец L, он закодирован для преобразования выбранной ячейки в Propercase, но теперь он преобразуется в Uppercase.Код столбца I полностью игнорируется.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Cleanup
Application.EnableEvents = False: Application.ScreenUpdating = False: Application.Calculation = xlCalculationManual
'converts staff codes into uppercase
If Not (Application.Intersect(Target, Me.UsedRange.Columns("K")) Is Nothing) And Not Target.Row = 15 Then
Target.Value2 = UCase$(Target.Value2)
End If
'converts Rep Codes into uppercase
If Not (Application.Intersect(Target, Me.UsedRange.Columns("J")) Is Nothing) And Not Target.Row = 15 Then
Target.Value2 = UCase$(Target.Value2)
End If
'converts Staff Names into proper case,
If Not (Application.Intersect(Target, Me.UsedRange.Columns("L")) Is Nothing) And Not Target.Row = 15 Then
Target.Value2 = StrConv(Target.Value2, vbProperCase)
End If
'converts staff type into capitals.
If Not (Application.Intersect(Target, Me.UsedRange.Columns("I")) Is Nothing) And Not Target.Row = 15 Then
Target.Value2 = UCase$(Target.Value2)
End If
'converts store code into uppercase
If Not (Application.Intersect(Target, Range("STORE_CODE")) Is Nothing) Then
Target.Value2 = UCase$(Target.Value2)
End If
'converts store name into propercase
If Not (Application.Intersect(Target, Range("STORE_NAME")) Is Nothing) Then
Target.Value2 = StrConv(Target.Value2, vbProperCase)
End If
'copy pay value one cell over into hidden column
If Not (Application.Intersect(Target, Me.UsedRange.Columns("G")) Is Nothing) Then
Target.Offset(0, 1).Value2 = Target.Value2
Target.Value2 = ""
End If
Cleanup:
Application.EnableEvents = True: Application.ScreenUpdating = True: Application.Calculation = xlCalculationAutomatic ' etc..
End Sub