mailpargyan
01-19-2013, 04:13 AM
Hello ,
I am using following web code for Shifting a row data from B Column (containing List of 4 options i.e. Network, billing, Resolved & GMCC through validation option) to Another Sheet & from that sheet to Another or Original Sheet. In original sheet I've pasted the following . It is working & Transferring
row to another. ONCE I pasted same code to another than I'll getting error .
Please help to resolve the error.
Option Explicit
Dim Flag As Boolean
Private Sub Worksheet_Change(ByVal Target As Range)
Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
If Flag = True Then Exit Sub
If Not Intersect(Target, Range("B1:B" & LR)) Is Nothing Then
If Target.Value = "BILLING" Then
LR = Sheets("Billing").Range("A" & Rows.Count).End(xlUp).Row + 1
Target.EntireRow.Copy
Sheets("Billing").Range("A" & LR).PasteSpecial
Flag = True
Target.EntireRow.Delete
Else
If Target.Value = "NETWORK" Then
LR = Sheets("Network").Range("A" & Rows.Count).End(xlUp).Row + 1
Target.EntireRow.Copy
Sheets("Network").Range("A" & LR).PasteSpecial
Flag = True
Target.EntireRow.Delete
Else
If Target.Value = "RESOLVED" Then
LR = Sheets("Resolved").Range("A" & Rows.Count).End(xlUp).Row + 1
Target.EntireRow.Copy
Sheets("Resolved").Range("A" & LR).PasteSpecial
Flag = True
Target.EntireRow.Delete
Else
LR = Sheets("GMCC").Range("A" & Rows.Count).End(xlUp).Row + 1
Target.EntireRow.Copy
Sheets("GMCC").Range("A" & LR).PasteSpecial
Flag = True
Target.EntireRow.Delete
End If
End If
End If
End If
Application.CutCopyMode = False
Flag = False
End Sub
I am using following web code for Shifting a row data from B Column (containing List of 4 options i.e. Network, billing, Resolved & GMCC through validation option) to Another Sheet & from that sheet to Another or Original Sheet. In original sheet I've pasted the following . It is working & Transferring
row to another. ONCE I pasted same code to another than I'll getting error .
Please help to resolve the error.
Option Explicit
Dim Flag As Boolean
Private Sub Worksheet_Change(ByVal Target As Range)
Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
If Flag = True Then Exit Sub
If Not Intersect(Target, Range("B1:B" & LR)) Is Nothing Then
If Target.Value = "BILLING" Then
LR = Sheets("Billing").Range("A" & Rows.Count).End(xlUp).Row + 1
Target.EntireRow.Copy
Sheets("Billing").Range("A" & LR).PasteSpecial
Flag = True
Target.EntireRow.Delete
Else
If Target.Value = "NETWORK" Then
LR = Sheets("Network").Range("A" & Rows.Count).End(xlUp).Row + 1
Target.EntireRow.Copy
Sheets("Network").Range("A" & LR).PasteSpecial
Flag = True
Target.EntireRow.Delete
Else
If Target.Value = "RESOLVED" Then
LR = Sheets("Resolved").Range("A" & Rows.Count).End(xlUp).Row + 1
Target.EntireRow.Copy
Sheets("Resolved").Range("A" & LR).PasteSpecial
Flag = True
Target.EntireRow.Delete
Else
LR = Sheets("GMCC").Range("A" & Rows.Count).End(xlUp).Row + 1
Target.EntireRow.Copy
Sheets("GMCC").Range("A" & LR).PasteSpecial
Flag = True
Target.EntireRow.Delete
End If
End If
End If
End If
Application.CutCopyMode = False
Flag = False
End Sub