Consulting

Results 1 to 4 of 4

Thread: vba code moving data of row from one sheet to another & vice versa

  1. #1

    Wink vba code moving data of row from one sheet to another & vice versa

    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.


    [vba]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[/vba]

  2. #2
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,060
    Location
    What is the error you are receiving?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  3. #3

    Aussiebear

    hOW COULD I , CROSS CONNECTED ALL THE WORKSHEETS FOR THE SAME PURPOSE. sHALL i PASRED SAME CODE ON ALL WORKSHEETS( DO THIS IS GENERATING AN ERROR) OR THERE ARE SOME OTHER SUGGESTION TO DOING IT.

  4. #4
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,060
    Location
    Firstly, please type in lower case letters as using capital letters is considered poor internet conversation.

    I asked you what is the error you are receiving? Is your code failing on a particular line of code, and if so, which line is it? Or is it simply that your code is not doing that which you had hoped for it to complete?

    Can you indicate which part is completeing and or which parts are not? Is it possible for you to upload a sample file which we can use to simulate your issue? To upload a sample file, click on Go Advanced, scroll down to Manage Attachments and follow the prompts from there.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •