+ Reply to Thread
Results 1 to 6 of 6

Search and destroy subroutines

  1. #1
    Forum Contributor
    Join Date
    02-26-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    173

    Search and destroy subroutines

    Hello again ExcelForum friends!

    Lately I've been using excel to copy web pages and then run a macro to turn it into a usable set spreadsheet of data but the paste results keep slightly shifting cell locations. Would it be possible to do something like the following?

    Here is a Sample.xlsx file to keep us on the same page.

    I was thinking a function SearchCells() and it would work something like SearchCells("Sample", 1) would return the cell location "B4" and SearchCells("Sample", 2) would return the cell location "C4". SearchCells("Sample") would just default to first "Sample" found.

    All help and suggestions appreciated!

    Edit: Sorry about the bad title. Went in a slightly different route with the thread, choosing to start with 1 primary component rather than the whole problem.
    Last edited by smpita; 07-29-2014 at 03:24 PM.

  2. #2
    Forum Contributor
    Join Date
    02-26-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    173

    Re: Search and destroy subroutines

    Oh and return something like "NotFound" on something like SearchCells("Sample", 5) or SearchCells("Keyword not on spreadsheet", 1)

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Search and destroy subroutines


    Hi,

    you can use Find method (by rows or by columns) and a counter variable …

  4. #4
    Forum Contributor
    Join Date
    02-26-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    173

    Re: Search and destroy subroutines

    This is what I have so far, but it is not yet complete:

    Please Login or Register  to view this content.
    Last edited by smpita; 07-29-2014 at 04:08 PM.

  5. #5
    Forum Contributor
    Join Date
    02-26-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    173

    Re: Search and destroy subroutines

    I think I got the framework laid out, now to make it work.

    Please Login or Register  to view this content.
    Last edited by smpita; 07-29-2014 at 06:50 PM.

  6. #6
    Forum Contributor
    Join Date
    02-26-2014
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    173

    Re: Search and destroy subroutines

    Going to start a new thread with an appropriate title. Closing this one. Thanks all!

    Follow this topic on http://www.excelforum.com/excel-prog...ml#post3785355
    Last edited by smpita; 07-29-2014 at 06:47 PM.

+ 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] can't debug some subroutines in my project, locked subroutines
    By florin_excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-28-2012, 01:16 PM
  2. Search and change! (not and destroy!)
    By mhax in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2006, 02:21 PM
  3. Search & Destroy
    By Ben H in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2006, 02:00 PM
  4. Cannot destroy Word Object in Excel
    By dai50 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-29-2006, 07:11 AM
  5. [SOLVED] Search and destroy
    By Pugwyrm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-14-2005, 12:06 PM

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