Error "Object Doesn't Support this Property or Method" - Pull data from another tab

  • Hello,


    I had a macro that would prompt the user to choose a file/workbook (x) to open up, and then the macro would take some data from workbook x and insert and paste the lines into workbook y. Instead of opening up workbook x, I decided to just put the needed tab from workbook x and manually add it as a tab in workbook y. I'm trying to modify my code so that it will still take the data need from the newly added tab in workbook y, and insert and paste those rows into another tab in workbook y. However, I keep getting an error saying "Object Doesn't Support this Property or Method." Any ideas on how to fix this would be greatly appreciated!


    Code
    Set rngFound = .Find(What:=wsVENDOR, LookAt:=xlWhole, LookIn:=xlValues, MatchCase:=False)


    Above is the line is where the error appears when I step through the code.



    Below is my whole code:



    Thanks!

  • Re: Error "Object Doesn't Support this Property or Method" - Pull data from another t


    ...rngFound = .Find(What:=wsVENDOR, LookAt


    wsVendor is defined as a Worksheet. The Find parameter takes a String/Number/Date, not a worksheet as its value

  • Re: Error "Object Doesn't Support this Property or Method" - Pull data from another t


    How would I fix this if I need the Find parameter to reference the worksheet. The work around this in the old code was classify the file as fname, which had a dimension string definition, and that was what used to be in place of wsVENDOR..

  • Re: Error "Object Doesn't Support this Property or Method" - Pull data from another t


    Quote

    ...which had a dimension string definition


    That's exactly what you need here. How can you 'Find' a worksheet? Find is a method of a range object, you defined that range as wsCD.Columns("L"), so you want to search that range for some value - that's the value you use for the 'What' parameter


    More information - you need to understand this.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!