Meraba arkadaşlar. Ekte gönderdiğim tabloda tutar kısmının kontrolünü yapıyorum ve ortalarda yapılmış bir yanlış tutarı düzeltmeye çalışırken alt hücrelerin hepsini gizliyor. O satırı sildiğim zamanda aynısını yapıyor. Acaba derdime çare olabilirmisiniz. Hayırlı günler diliyorum. Makro koduda aşağıda
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Application.ScreenUpdating = False
If Target.Column <> 4 Or Target.Address = "$D$1" Then Exit Sub
If Target = "" Then
Rows("2:65536").EntireRow.Hidden = False
Range(Cells(Target.Row + 1, 2), Cells(65536, 5)).Clear
Range(Cells(Target.Row + 1, 1), Cells(65536, 256)).EntireRow.Hidden = True
Else
Rows("2:65536").EntireRow.Hidden = False
Range(Cells(Target.Row, 2), Cells(Target.Row, 3)).AutoFill Destination:=Range(Cells(Target.Row, 2), Cells(Target.Row + 1, 3)), Type:=xlFillDefault
Cells(Target.Row, 5).AutoFill Destination:=Range(Cells(Target.Row, 5), Cells(Target.Row + 1, 5)), Type:=xlFillDefault
Cells(Target.Row + 1, 2).ClearContents
With Cells(Target.Row + 1, 4)
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeRight).LineStyle = xlContinuous
.Interior.ColorIndex = 40
.NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"
.Font.Name = "Century Gothic"
End With
Rows(Target.Row + 2).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Hidden = True
Cells(Target.Row + 1, 1).Select
End If
Application.ScreenUpdating = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Application.ScreenUpdating = False
If Target.Column <> 4 Or Target.Address = "$D$1" Then Exit Sub
If Target = "" Then
Rows("2:65536").EntireRow.Hidden = False
Range(Cells(Target.Row + 1, 2), Cells(65536, 5)).Clear
Range(Cells(Target.Row + 1, 1), Cells(65536, 256)).EntireRow.Hidden = True
Else
Rows("2:65536").EntireRow.Hidden = False
Range(Cells(Target.Row, 2), Cells(Target.Row, 3)).AutoFill Destination:=Range(Cells(Target.Row, 2), Cells(Target.Row + 1, 3)), Type:=xlFillDefault
Cells(Target.Row, 5).AutoFill Destination:=Range(Cells(Target.Row, 5), Cells(Target.Row + 1, 5)), Type:=xlFillDefault
Cells(Target.Row + 1, 2).ClearContents
With Cells(Target.Row + 1, 4)
.Borders(xlEdgeLeft).LineStyle = xlContinuous
.Borders(xlEdgeTop).LineStyle = xlContinuous
.Borders(xlEdgeBottom).LineStyle = xlContinuous
.Borders(xlEdgeRight).LineStyle = xlContinuous
.Interior.ColorIndex = 40
.NumberFormat = "_($* #,##0.00_);_($* (#,##0.00);_($* ""-""??_);_(@_)"
.Font.Name = "Century Gothic"
End With
Rows(Target.Row + 2).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Hidden = True
Cells(Target.Row + 1, 1).Select
End If
Application.ScreenUpdating = True
End Sub