+ Reply to Thread
Results 1 to 8 of 8

PLEASE HELP - Macro needed to transfer data to another sheet if it meets a one criteria

  1. #1
    Registered User
    Join Date
    05-10-2012
    Location
    Leicester, England
    MS-Off Ver
    Excel 2003
    Posts
    14

    PLEASE HELP - Macro needed to transfer data to another sheet if it meets a one criteria

    Hi all

    I am new to VBA programming and I just cannot get my head around this macro, I know it is possible but I'm stumped PLEASE HELP!

    I have customer data on a sheet for May and I need to transfer only the active customers' data to a June sheet, the sheets' formats are identical. There is a single criteria - if column N is blank then all the data in that ROW needs to be copied and transfered to the June sheet (the original data needs to remain on the May sheet).

    The ranges are A8:AN308.

    There is one more thing - I will be linking the macro to a command button and I would like the macro to clear any existing data in the June sheet (A8:AN308) before running the transfer..............am I asking too much?

    Can anyone help me????

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

    Re: PLEASE HELP - Macro needed to transfer data to another sheet if it meets a one criteri

    There are many ways to do this, like using filter, looping, etc. I have used one. Try this
    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 View | Macros
    Select a macro in the list, and click the Run button.
    Last edited by arlu1201; 05-10-2012 at 09:08 AM.
    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
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: PLEASE HELP - Macro needed to transfer data to another sheet if it meets a one criteri

    Another code using filter.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-10-2012
    Location
    Leicester, England
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: PLEASE HELP - Macro needed to transfer data to another sheet if it meets a one criteri

    Thank you Arlette, I have tried the first one and it is doing exactly what I need except it is copying the data to row 4 onwards and not row 8, (I have preset formulas in the first seven rows) what do I need to change to amend this as this is way above my level of understanding?

    Thanks again

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

    Re: PLEASE HELP - Macro needed to transfer data to another sheet if it meets a one criteri

    I have edited my first code but it originally started with row 7 as the header, not row 4. Try it on a copy of your file and let me know if you are facing any issues.

  6. #6
    Registered User
    Join Date
    05-10-2012
    Location
    Leicester, England
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: PLEASE HELP - Macro needed to transfer data to another sheet if it meets a one criteri

    Hi Arlette

    I am still getting the same problem and so I have attached a sample copy of the file with mock data so that you can see exactly
    what I mean.

    Your help is much appreciated
    Attached Files Attached Files

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

    Re: PLEASE HELP - Macro needed to transfer data to another sheet if it meets a one criteri

    Actually i had edited my code after posting it and i guess you didnt pick up the updates. I will test it on your file and post your updated code here.

    Try this code:
    Please Login or Register  to view this content.
    Last edited by arlu1201; 05-10-2012 at 09:54 AM. Reason: Code included.

  8. #8
    Registered User
    Join Date
    05-10-2012
    Location
    Leicester, England
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: PLEASE HELP - Macro needed to transfer data to another sheet if it meets a one criteri

    That is great Arlette, thanks again for all your help

+ 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