+ Reply to Thread
Results 1 to 20 of 20

Multiple move/delete #N/A with vlookups

  1. #1
    Registered User
    Join Date
    01-28-2015
    Location
    CA
    MS-Off Ver
    2007
    Posts
    67

    Multiple move/delete #N/A with vlookups

    Please Login or Register  to view this content.
    This is the current code i', working with, and it somewhat works for the first maco sub, but i'm at least 80% sure that there is a waaay easier way to accomplish what i'm going for:

    Okay so i spliced together 4 subs which the first 2 work (sometimes), but the last 2 do not?
    My objective is simple, and you can use this as a reference: https://app.box.com/s/28q2ibnryvu60i8sayj0atbiza4m4qym

    So here is the plan:
    1. Vlookup column A in "Master Supra" to lookup sheet "Data Creation"
    2. Anything that comes up #N/A move to "Supra Disco" & Delete from original sheet
    3. Delete vlookup column

    4. Vlookup Column A in "Data Creation" to lookup sheet "Master Supra"
    5. Anything that comes up #N/A copy/paste to "Master Supra" WITH THE APPROPRIATE COLUMNS (highlighted yellow?) (KEEP IN ORIGINAL SHEET)
    6. Delete vlookup column

    *NOTE* i had not attempted moving the data from Data Creation -> Master Supra with the correct columns
    I.E: "Title Generator" goes into "Item_Name", "Price Calc" goes into "Price". I'm not so lost that i can't figure out how to change the destionations of the cells, i just don't know VBA to this extent i've just been splicing VBA from things i find on the web.

    Any and all help would be AMAZING
    Last edited by BlakeSkate; 04-21-2015 at 05:31 PM. Reason: Solved

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,943

    Re: Multiple move/delete #N/A with vlookups

    Please upload the sample workbook in the form and I'll look at it.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    01-28-2015
    Location
    CA
    MS-Off Ver
    2007
    Posts
    67

    Re: Multiple move/delete #N/A with vlookups

    Quote Originally Posted by TMS View Post
    Please upload the sample workbook in the form and I'll look at it.

    Regards, TMS
    Thats what the reference link is. unless there is another specific way i should be sharing the worksheet? (sorry if i missed that rule)

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,943

    Re: Multiple move/delete #N/A with vlookups

    You have provided a link to an external host; not everyone will download from elsewhere, me included.


    To attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  5. #5
    Registered User
    Join Date
    01-28-2015
    Location
    CA
    MS-Off Ver
    2007
    Posts
    67

    Re: Multiple move/delete #N/A with vlookups

    FOREXCEL.xlsx

    i believe this is it

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,943

    Re: Multiple move/delete #N/A with vlookups

    This just gets the required records from A to B. I'll leave you to sort out any restructuring.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-28-2015
    Location
    CA
    MS-Off Ver
    2007
    Posts
    67

    Re: Multiple move/delete #N/A with vlookups

    Hey TMS,
    that worked really well for getting everything into the disco sheet, and i'm assuming this is just for steps 1-3?
    Can i contact you if i have any troubles getting this to work from 4-6?

    you've been a huge help thanks!

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,943

    Re: Multiple move/delete #N/A with vlookups

    Yes, that's just steps 1 to 3. If I'm honest, I didn't even notice steps 4 to 6.

    It should be pretty much the same as steps 1 to 3 with the worksheets changed. You can use the same Helper column; obviously, the COUNTIF formula needs adjustment. And don't delete the rows after the copy.

    I don't think there's any short cut ... you just need to re-work the code.

    Good luck with it.


    Regards, TMS

  9. #9
    Registered User
    Join Date
    01-28-2015
    Location
    CA
    MS-Off Ver
    2007
    Posts
    67

    Re: Multiple move/delete #N/A with vlookups

    Quote Originally Posted by TMS View Post

    Good luck with it.
    Thank you, i'm sure i'll get it

  10. #10
    Registered User
    Join Date
    01-28-2015
    Location
    CA
    MS-Off Ver
    2007
    Posts
    67

    Re: Multiple move/delete #N/A with vlookups

    TMS, i actually got the code to work for the "adding to the Master Supra" step
    Kudos to you for having an easy to understand naming convention (wsMS, wsSD, wsDC)

    I am having trouble with step 5 in that i need to organize the data. I have a question that has nothing to do with the code you provided: Can i use countif to identify a starting point for simple cut and pastes? I've attached another sheet to illustrate my dilemma. So if you click on column A and CTRL+Down you will notice the gap where the new data is being entered. My approach was initially

    Please Login or Register  to view this content.
    BUT there are some columns where there are blank cells so "Selection.End(xlDown).Select" is not accurate enough. Is there a way to move this data right below the gap to the appropriate columns while maintaining its row number?

    Thanks for the help!
    Attached Files Attached Files

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,943

    Re: Multiple move/delete #N/A with vlookups

    I would be inclined to do something like this:

    Please Login or Register  to view this content.

    Not really comfortable about establishing the first row but, if that's how your data is structured ...


    Regards, TMS

  12. #12
    Registered User
    Join Date
    01-28-2015
    Location
    CA
    MS-Off Ver
    2007
    Posts
    67

    Re: Multiple move/delete #N/A with vlookups

    TMS, if you think there is a more efficient way then by all means. i was just doing what i know how to do (which is not much)

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,943

    Re: Multiple move/delete #N/A with vlookups

    No. It works. I'd probably not leave a gap and save the start row when I copied the data there. Then a) you already know where to start because you just put the data there and b) all you need to do is establish the last row. You only need to do those things once, as in the example, and you can copy and clear as many ranges as you want. I'm not using Cut in case it moves columns across ... prefer two stage Copy and ClearContents.


    Regards, TMS

  14. #14
    Registered User
    Join Date
    01-28-2015
    Location
    CA
    MS-Off Ver
    2007
    Posts
    67

    Re: Multiple move/delete #N/A with vlookups

    Thank you so much for your help!

  15. #15
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,943

    Re: Multiple move/delete #N/A with vlookups

    You're welcome.

  16. #16
    Registered User
    Join Date
    01-28-2015
    Location
    CA
    MS-Off Ver
    2007
    Posts
    67

    Re: Multiple move/delete #N/A with vlookups

    Pay no mind to this post i figured it out
    Last edited by BlakeSkate; 04-16-2015 at 03:48 PM. Reason: Found a work around

  17. #17
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,943

    Re: Multiple move/delete #N/A with vlookups

    The code looked OK, as far as I could see without having the opportunity to test it. What did you do to "fix" it?

    Regards, TMS

  18. #18
    Registered User
    Join Date
    01-28-2015
    Location
    CA
    MS-Off Ver
    2007
    Posts
    67

    Re: Multiple move/delete #N/A with vlookups

    Quote Originally Posted by TMS View Post
    What did you do to "fix" it?

    Please Login or Register  to view this content.
    ^ i changed it so it pasted? it works perfectly now with 0 bugs no matter how much the data changes so again THANK YOU

  19. #19
    Registered User
    Join Date
    01-28-2015
    Location
    CA
    MS-Off Ver
    2007
    Posts
    67

    Re: Multiple move/delete #N/A with vlookups

    Also asked TMS for those of you that might encounter an error when there is no new data to add from one worksheet to the other:

    Please Login or Register  to view this content.
    thanks TMS!

  20. #20
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,943

    Re: Multiple move/delete #N/A with vlookups

    You're welcome.

+ 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. [SOLVED] Multiple Vlookups
    By Sasquatch2014 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-11-2014, 05:12 PM
  2. Move/Delete items between multiple list boxes in a UserForm that correspond to tables
    By salvo2002 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2014, 07:43 PM
  3. [SOLVED] Move/Copy worksheets (possibly) using vlookups
    By daniel_t in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-09-2013, 11:56 AM
  4. VLOOKUPS in multiple closed workbooks with multiple tabs
    By exclusivelyexcel in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-23-2011, 03:33 PM
  5. delete row if one of multiple values and then move on top
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-01-2009, 01:30 AM

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