+ Reply to Thread
Results 1 to 5 of 5

Macro to filter map coordinates

  1. #1
    Forum Contributor
    Join Date
    04-30-2013
    Location
    arizona
    MS-Off Ver
    365
    Posts
    147

    Macro to filter map coordinates

    Macro to filter map coordinates
    I am looking for a macro that can do the following:

    1. For every sheet that exists in the workbook (I may add others) except for sheets: “Instructions”, “Instructions2”, and “Comps”:
    take my distance formula (that I placed in C2 of Sheets 4-7) and plug in the cell coordinates for each row that has coordinates in sheet “Comps” . For example Sheet 4 formula will look like this for Row 2: “=GetMiles($A2,$B2,Comps!A2,Comps!B2)”

    2. Then if the formula value yields a number less than 25 I would like to copy the entire row from the “Comps” sheet (A:Z) and paste it in order (no gaps)starting on row 5 of the corresponding sheet. For example, the formula above yields a distance of 11.17 which is less than 25 so Row 2 of Comps should be copied and pasted in Row 5 of Sheet 4 reading “33.4941639 -112.0377714 Phoenix AZ”

    Can any one help me with this?
    Attached Files Attached Files

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Macro to filter map coordinates

    Not much error handling or cleanup.

    See attachment.
    Attached Files Attached Files
    David
    (*) Reputation points appreciated.

  3. #3
    Forum Contributor
    Join Date
    04-30-2013
    Location
    arizona
    MS-Off Ver
    365
    Posts
    147

    Re: Macro to filter map coordinates

    Works great thanks.

  4. #4
    Forum Contributor
    Join Date
    04-30-2013
    Location
    arizona
    MS-Off Ver
    365
    Posts
    147

    Re: Macro to filter map coordinates

    I noticed after looking at this macro that instead of posting every coordinate that meet the criteria in "A5" and below it filtered through each coordinate and then just posted the last coordinate that applied.
    For example, on "Sheet4" instead of posting all the coordinates that applied to the filter it just posted the very last coordinate only (33.34954 and -111.956). It also copied the last applicable coordinate multiple times.
    Does any one have an idea how to fix that?

  5. #5
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Macro to filter map coordinates

    Arghh! (slaps forehead) I forgot to increment NextRow in the B loop.

    Try it now.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    04-30-2013
    Location
    arizona
    MS-Off Ver
    365
    Posts
    147

    Re: Macro to filter map coordinates

    That seemed to do it.
    Thanks a ton.

+ 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