+ Reply to Thread
Results 1 to 8 of 8

Copy data with negative value in separate sheet

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Copy data with negative value in separate sheet

    Hello:

    Please refer to attached sheet.

    I have lots of data in Sheet1 Column A:Column P.

    I need a VB Macro or formula to separate out in sheet2 all the data where Data in sheet1 column P is negative.

    I have manually copied 2 negative records in sheet2 for your referance.

    Please let me know if any questions.

    Thank you

    Riz Momin
    Attached Files Attached Files
    Last edited by rizmomin; 07-27-2013 at 05:08 PM.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy data with negative value in separate sheet

    Hi Riz,

    Try the attached. There are two codes. One is filter and the second one is loop.
    Attached Files Attached Files
    Last edited by AB33; 07-27-2013 at 02:51 PM.

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Copy data with negative value in separate sheet

    See the attached file.

    I used the code of Ron de Bruin to do the job.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Copy data with negative value in separate sheet

    Hi oeldere :

    It looks like your code should work for me with little tweaking and i would need help.
    For some reason, it creates 2 Error_ sheets.
    I would prefer to have only 1 sheet created instead of 2.
    Also would need to clear that sheet and rewrite when macro is run 2nd time.
    Would need to have heading in row 1 and not to clear that.
    Also would like to see if it is possible to add one more condition and that is only copy data for Store # 10687 (Store # is in column A of Sheet1)

    Please let me know if any questions.

    Thank you

    Riz Momin

  5. #5
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Copy data with negative value in separate sheet

    Hi AB33:

    When i apply your code to my workbook, it gives error at
    Please Login or Register  to view this content.
    Please have a look and let me know if i need to change any thing else.

    Thank you

    Riz Momin

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Copy data with negative value in separate sheet

    @Riz monin

    I don't get an failure if i run the code of AB 33!

    I changed the code of AB 33 so your aditional request (in post 4) is also solved.

    See the attached file.

    All credit to AB 33, since he / she made the code.
    Attached Files Attached Files

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Copy data with negative value in separate sheet

    Do you really need a macro for this?

    1/. Filter Sheet1 Column P > Number Filters > Is Less than ... 0

    2/. Copy the result including the headers to Sheet2 A2

    3/. Select the Result in Sheet 1 excluding the headers then Delete > Rows

    4/. Remove the filter
    Last edited by Marcol; 07-27-2013 at 03:50 PM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  8. #8
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Copy data with negative value in separate sheet

    Hi AB33 & oeldere:

    I must give credit to both of you for great help.
    The code works great.

    Thank you

    Riz Momin

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 07-25-2013, 05:09 PM
  2. Macro to copy data to separate excel sheet
    By eric86 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-27-2012, 05:16 PM
  3. Replies: 0
    Last Post: 09-25-2012, 02:31 PM
  4. Replies: 0
    Last Post: 01-06-2010, 05:57 PM
  5. Copy Pictures from separate sheets to one singe sheet.
    By Fishwise in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-17-2009, 03:03 PM

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