+ Reply to Thread
Results 1 to 11 of 11

Match & Align VBA

  1. #1
    Registered User
    Join Date
    05-11-2010
    Location
    Bay Area, Ca
    MS-Off Ver
    Office 2007
    Posts
    6

    Exclamation Match & Align VBA

    Hi everyone,

    I have no experience with VBA programming and I'm hoping that someone can help me. Here is the example situation:

    I have a spreadsheet that contains inventory information. One of the columns has a SKU number I have defined to track the products. I have another spread sheet with SKUs of items that have sold. I need to match the two columns, then align the SKUs. I need the matching SKU to be aligned to the same row. If a SKU does not match, I need a way of identifying it.

    I've attached an example XLS file. The first column will be where I placed the SKUs from a different spreadsheet. The data in all columns except the first are associated with the SKU in column "SKU". It would be best if only the cells in the column "To Be Matched" be the only cells that move when aligned.

    I hope someone can help me. A VBA like this would save me so much time. I have hundreds if not thousands of entries. Doing it by hand will take forever, and I most likely will make errors.
    Attached Files Attached Files
    Last edited by outback6; 05-11-2010 at 05:29 PM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Match & Align VBA

    Might not need VBA, but in any case your attachment didn't work.

  3. #3
    Registered User
    Join Date
    05-11-2010
    Location
    Bay Area, Ca
    MS-Off Ver
    Office 2007
    Posts
    6

    Re: Match & Align VBA

    Wow your fast. I just uploaded it.

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Match & Align VBA

    I'm psychic. OK let me ask why you want this done? I can't see the point!

    EDIT: is this the point?
    If a SKU does not match, I need a way of identifying it.

  5. #5
    Registered User
    Join Date
    05-11-2010
    Location
    Bay Area, Ca
    MS-Off Ver
    Office 2007
    Posts
    6

    Re: Match & Align VBA

    No problem.

    To make it simple, I have two databases, that don't cross talk. My sales associates use an online base program to create and list auctions to ebay. Then I need to access each individual auction, to gather data, and create a listing for our website.

    The problem is, due to the way ebay exports their data. Auctions that are "Fixed Price" or buy it now, cannot be isolated. The only way for me to get these auctions in any list is to export all Active listings. Because of this issue, I have a lot of extra listing data that I need to filter. I've been able to filter out the real auctions. So I'm left will all fixed price auctions. However some of these fixed price auctions have already been listed onto the website. I need to figure out which ones have not been listed.

    I found VBA which lets compare me the CSV upload SKUs (for website inventory) to the CSV export SKUs (from ebay) to see which fixed price auctions I have on the website and which I need to list. The resulting list of SKUs are from the CSV export (from ebay) which need to be uploaded.

    This is where the current VBA helps. I need it to align the generated list of SKUs back to the SKUs from the CSV export. When I align the SKUs I'll have the rest of the data associated with those SKUs to quickly copy and paste into a CSV file for upload to the website.

    Essentially there is data that makes me life much easier in the CSV export from ebay. But I need to filter out the erroneous listings and isolate the listings that are fixed auction and have not been listed on our website.
    Last edited by outback6; 05-11-2010 at 05:43 PM.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Match & Align VBA

    In the attachment, I moved the Item ID column to the right of the SKU column.

    Then I selected A1:B1, and typed keys in the Names box (left of the Formula bar).

    Then did Alt+F8, selected AlignKeys (a macro I added to the workbook) and pressed Run.
    Attached Files Attached Files
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    05-11-2010
    Location
    Bay Area, Ca
    MS-Off Ver
    Office 2007
    Posts
    6

    Re: Match & Align VBA

    Try reading the above post. I edited several times, hopefully its more clear about my goals.

  8. #8
    Registered User
    Join Date
    05-11-2010
    Location
    Bay Area, Ca
    MS-Off Ver
    Office 2007
    Posts
    6

    Re: Match & Align VBA

    Quote Originally Posted by shg View Post
    In the attachment, I moved the Item ID column to the right of the SKU column.

    Then I selected A1:B1, and typed keys in the Names box (left of the Formula bar).

    Then did Alt+F8, selected AlignKeys (a macro I added to the workbook) and pressed Run.
    Close! I took your spreadsheet and copied in the data. Nearly 1500 listings. Then I took the filtered SKUs that I needed to align and placed it in the "To Be Matched" column. Ran the macro, and BAM! It aligned all the SKUs in the "To Be Matched" column to the "SKU" column.

    However, it placed all the SKUS at the bottom of my spreadsheet. I need to everything to stay in place. Because the rest of the spreadsheet contains information associated with the SKUs in the "SKUs" column. That is really the information I'm hunting for.

    I think the hardest part about this VBA macro is keeping all the cells in all the columns stationary, except for the cells in the "To Be Matched" Column. Its extremely vital that all that information stays associated to its proper sku in the "SKUs" column. That is the information I need to mine out of the spreadsheet.
    Last edited by outback6; 05-11-2010 at 05:53 PM.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Match & Align VBA

    Yup, sorry, that's not the way it works. It puts both sections in alpabetical order, then inserts spaces in one section of the other until like rows align.
    Last edited by shg; 05-11-2010 at 05:59 PM.

  10. #10
    Registered User
    Join Date
    05-11-2010
    Location
    Bay Area, Ca
    MS-Off Ver
    Office 2007
    Posts
    6

    Re: Match & Align VBA

    I did find this sample sheet somewhere on the internet. I'm not sure how to edit the VBA to make it fit my needs. However it does do exactly what I need.

    Edit: Fixed the attachment. The file I first attached was already aligned.
    Also looks like its the same or of the same VBA code you used. Its just that the list it compares to doesn't move. I dunno how they did that.
    Attached Files Attached Files
    Last edited by outback6; 05-11-2010 at 06:04 PM.

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Match & Align VBA

    It's the exact same code.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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