This is the macro what is the error.. When cell D40 is clicked all the macros are called and they are all the same (except ---- for different sheets)....
When i debug it points to this an error - ""If Target.Address = "$D$40" Then Call Sheet9.Remove_Zeros""....
After i delete it it shows this as an error - ""If Target.Address = "$D$40" Then Call Sheet2.Remove_Zeros""....
What should i do??
I am new to vba n macros ..
Pls HElP ME.....
The code in those macros are as follows...--------------
When i debug it points to this an error - ""If Target.Address = "$D$40" Then Call Sheet9.Remove_Zeros""....
After i delete it it shows this as an error - ""If Target.Address = "$D$40" Then Call Sheet2.Remove_Zeros""....
What should i do??
I am new to vba n macros ..
Pls HElP ME.....
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$D$40" Then Call Sheet2.Remove_Zeros
If Target.Address = "$D$40" Then Call Sheet3.Remove_Zeros
If Target.Address = "$D$40" Then Call Sheet6.Remove_Zeros
If Target.Address = "$D$40" Then Call Sheet7.Remove_Zeros
If Target.Address = "$D$40" Then Call Sheet8.Remove_Zeros
If Target.Address = "$D$40" Then Call Sheet9.Remove_Zeros
End Sub
The code in those macros are as follows...--------------
Code:
Sub Remove_Zeros()
Sheets("Details").Activate
Dim LRow As Long, n As Long
LRow = Range("B1000000").End(xlUp).Row
For n = LRow To 1 Step -1
If Cells(n, 2).Value = 0 Then Cells(n, 2).EntireRow.Delete
Next n
End Sub