Уважаемы форумчане опять прошу помочь бился всю ночь дабы заставить работать две функции на одном листе не получилось!!! Они конфликтуют! Смотрел в интернете но так никчему не пришел.
Уважаемы форумчане опять прошу помочь бился всю ночь дабы заставить работать две функции на одном листе не получилось!!! Они конфликтуют! Смотрел в интернете но так никчему не пришел.plohish
Private Sub Worksheet_Change(ByVal Target As Range) Dim vVal Dim StrVal As String Dim dDate As Date
If Target.Cells.Count > 1 Then Exit Sub If Not Intersect(Target, Range("E2:E10,D2:D10")) Is Nothing Then With Target StrVal = Format(.Text, "000000") If IsNumeric(StrVal) And Len(StrVal) = 6 Then Application.EnableEvents = False dDate = DateValue(Left(StrVal, 2) & "/" & Mid(StrVal, 3, 2) & "/" & Right(StrVal, 2)) .NumberFormat = "dd/mm/yyyy" .Value = CDate(DateSerial(Year(dDate), Month(dDate), Day(dDate))) End If End With End If Application.EnableEvents = True
'End Sub ' 'Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Rows.Count > 1 Then Exit Sub If Target.Value = "" Then Exit Sub
Application.EnableEvents = False
If Not Intersect(Target, [A1:A10]) Is Nothing Then Target.Value = Target.Value & "/15/59/006-ип" End If
Application.EnableEvents = True
End Sub
[/vba]
[vba]
Код
Private Sub Worksheet_Change(ByVal Target As Range) Dim vVal Dim StrVal As String Dim dDate As Date
If Target.Cells.Count > 1 Then Exit Sub If Not Intersect(Target, Range("E2:E10,D2:D10")) Is Nothing Then With Target StrVal = Format(.Text, "000000") If IsNumeric(StrVal) And Len(StrVal) = 6 Then Application.EnableEvents = False dDate = DateValue(Left(StrVal, 2) & "/" & Mid(StrVal, 3, 2) & "/" & Right(StrVal, 2)) .NumberFormat = "dd/mm/yyyy" .Value = CDate(DateSerial(Year(dDate), Month(dDate), Day(dDate))) End If End With End If Application.EnableEvents = True
'End Sub ' 'Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Rows.Count > 1 Then Exit Sub If Target.Value = "" Then Exit Sub
Application.EnableEvents = False
If Not Intersect(Target, [A1:A10]) Is Nothing Then Target.Value = Target.Value & "/15/59/006-ип" End If