+ Reply to Thread
Results 1 to 16 of 16

VBA Code To Cut A Row From One Sheet To Another

  1. #1
    Registered User
    Join Date
    07-11-2012
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    91

    VBA Code To Cut A Row From One Sheet To Another

    VBA Code to cut an entire row(range a-bj)with the criteria of cells containing the word "adjustment deleted" and "reversal adjustment" in column c to another sheet named Deleted adjs. The number of rows differs everyday.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: VBA Code To Cut A Row From One Sheet To Another

    Do you want the cut paste to happen on the click of a button or on the selection from a dropdown?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    07-11-2012
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: VBA Code To Cut A Row From One Sheet To Another

    from a click button

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: VBA Code To Cut A Row From One Sheet To Another

    Try this code
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose Tools | Macro | Macros
    Select a macro in the list, and click the Run button

    You can also assign the code to a button and run it.

  5. #5
    Registered User
    Join Date
    07-11-2012
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: VBA Code To Cut A Row From One Sheet To Another

    what if there were no deleted adjustments for the day?

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: VBA Code To Cut A Row From One Sheet To Another

    Then it will check for reversal adjustment. If nothing there too, it will not show any data.

  7. #7
    Registered User
    Join Date
    07-11-2012
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: VBA Code To Cut A Row From One Sheet To Another

    i tried inputting reversal adjustments in one of the cells but it still doesn't work

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: VBA Code To Cut A Row From One Sheet To Another

    Check the spelling in the code v/s the spelling in your file and if both match, it should work.

  9. #9
    Registered User
    Join Date
    07-11-2012
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: VBA Code To Cut A Row From One Sheet To Another

    Oh. I thing it's copy-pasting for cells that are tagged "reversal adjustments" and "adjustment deleted." problem is it should filter for the cells containing for those words as that Column are for comments such as "adjustment deleted due to erroneous upload."


    The code below pretty much captures the gist of what the code should be:


    Please Login or Register  to view this content.
    The problem with the code above is that i need to click yes for deleting the deleted adj sheet and the code above debugs when there is no deleted adj/reversal

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: VBA Code To Cut A Row From One Sheet To Another

    Is this data in 2 separate sheets? Its better you explain with the help of a sample file. You didnt attach one at the beginning so i actioned according to your 1st post.

  11. #11
    Registered User
    Join Date
    07-11-2012
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: VBA Code To Cut A Row From One Sheet To Another

    Quote Originally Posted by arlu1201 View Post
    Is this data in 2 separate sheets? Its better you explain with the help of a sample file. You didnt attach one at the beginning so i actioned according to your 1st post.
    Hi.

    I'm attaching the file. But the lookup files are in a shared folder though. The deletion of cells containing those words are in Day1 button.

  12. #12
    Registered User
    Join Date
    07-11-2012
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: VBA Code To Cut A Row From One Sheet To Another

    I think the problem is that when there are no deleted adjustments and reversal adjustments, the code debugs. And with your code, it only filters "deleted adjustments" and "reversal adjustments" as is. I need to filter it with words containing the two criteria.

  13. #13
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: VBA Code To Cut A Row From One Sheet To Another

    I am not able to open your zip file since i have an issue with zip files. Maybe you can attach the excel file directly.

    And you can also try this code to pick up rows containing that text -
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    07-11-2012
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: VBA Code To Cut A Row From One Sheet To Another

    Can't upload it file is too large

  15. #15
    Registered User
    Join Date
    07-11-2012
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: VBA Code To Cut A Row From One Sheet To Another

    for some reason this one is not working

  16. #16
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: VBA Code To Cut A Row From One Sheet To Another

    Are you getting an error?

    You do not need to upload your entire file. Just a sample file with dummy data, as long as the format matches the original file.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1