+ Reply to Thread
Results 1 to 9 of 9

Need assistance moving code from sample doc to actual doc

  1. #1
    Registered User
    Join Date
    06-10-2010
    Location
    Chicago, IL, USA
    MS-Off Ver
    Excel 2013
    Posts
    19

    Need assistance moving code from sample doc to actual doc

    Ok, I am totally brain dead today. I have a workbook that someone here was kind enough to help me with. He created the VBA code to run a search across multiple tabs in a sample document.

    I have taken that code and applied it to the actual document and updated all of the tab names, cell references, etc. and it won't work. I get an error when I try to run the search.

    I need some assistance. Am I missing a step when I copy in the code?

    I have to have this available to my staff by the end of the week, so I am under the gun now.

    Thank you for any help!

    Sample List for Search Question.xls
    Catt33
    Chicago

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Need assistance moving code from sample doc to actual doc

    There no code in your attached workbook.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Need assistance moving code from sample doc to actual doc

    I wrote the code for you, I went to the prior post from aug and inserted into your attached workbook and it worked

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-10-2010
    Location
    Chicago, IL, USA
    MS-Off Ver
    Excel 2013
    Posts
    19

    Re: Need assistance moving code from sample doc to actual doc

    Mike,

    First of all, thank you so VERY much with your help putting the code together! I am singing your praises here at work any time someone asks me about this.

    When I copy the code into the actual document and change the references to the actual tab names and cell references (Updates = Front Page, C16 = E30, etc.) the search doesn't work. I just get an error.

    I do admit that it has been years since I had to do anything like this, so I am wondering if I may have missed a step in copying the code over to the actual document and search button. Or, if there is maybe a bit of code that isn't obvious that I need to change something to make it work in the actual document. [I really, really wish the orignal document wasn't confidential, or I would simply share it.]

    Again, thank you so much for your help with this!

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Need assistance moving code from sample doc to actual doc

    Can you post the code that you changed?

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Need assistance moving code from sample doc to actual doc

    And what cell has the sProductID to look up?

  7. #7
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Need assistance moving code from sample doc to actual doc

    Here I add some Const at the top of the code. You should just be able to change it there and the code should work

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-10-2010
    Location
    Chicago, IL, USA
    MS-Off Ver
    Excel 2013
    Posts
    19

    Re: Need assistance moving code from sample doc to actual doc

    Mike,

    I have spent every spare moment over the past week trying everything I know to get this to work. When I run the macro, I now get a runtime error 1004 "cannot change part of a merged cell."

    When I debug, this is the row that is highlighted...
    .Range(sOutputCol & lOutputRow & ":" & sOutputCol & .Cells(Rows.Count, sOutputCol).End(xlUp).Row + 2).Clear


    Can you please help me once more? Can I send you some cookies or a 6 pack?

  9. #9
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Need assistance moving code from sample doc to actual doc

    A 6 pack would be Great!

    Best advice I can give you is stay away from Merging Cells that you want to manipulate the data in those cells. Looking at your workbook you uploaded I dont see any merged cells. Im guessing Column B is merged with Column C or C with D. You can use Delete but that will unmerge the cells
    Please Login or Register  to view this content.

+ 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