+ Reply to Thread
Results 1 to 4 of 4

selective data sheet creation with using VBA

  1. #1
    Registered User
    Join Date
    06-08-2012
    Location
    Tasmania
    MS-Off Ver
    Excel 2003
    Posts
    4

    selective data sheet creation with using VBA

    Good evening / morning,

    Trying to solve this for my boss:

    there are 3 Columns in a sheet: Name / previousStock / newStock

    I need to get a macro to create another sheet named "Stock Adjustment Report"
    which will contain all 3 columns where "previousStock" value did not equal "newStock"

    Would be so grateful for a hint on how to tackle this one.

    Kind Regards,
    Last edited by Nodemoton; 06-08-2012 at 01:05 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: selective data sheet creation with using VBA

    You can do this with an autofilter. If you create a new 4th column with a formula that tests the two colums for a match.

    D2: =B2=C2
    ...copied down.

    Now turn on the autofilter and filter column D for FALSE, you're looking at your "report" without creating a second sheet.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    06-08-2012
    Location
    Tasmania
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: selective data sheet creation with using VBA

    Thank you so much. It worked, I managed to automatically record a macro as I applied autofilter on self-created columns referenced from another sheet - and everything solved itself !

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: selective data sheet creation with using VBA

    Good work.

    If that takes care of your need, please select Thread Tools from menu above and set this topic to SOLVED.

+ 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