+ Reply to Thread
Results 1 to 5 of 5

Get 1st and last addresses of cells in a range

  1. #1
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327

    Get 1st and last addresses of cells in a range

    Hi all,

    If I have more than one occurrence of a word (say "Ford") in Col A (say A1, A5, A10, and A14) and I want (with VBA) to return the number of occurrences and the first and last cell addresses (ie 4 times and "A1" and "A14") can anyone point me in the right direction please?

    Regards

    Seamus
    Hope this helps

    Seamus

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    May have over thought these but

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    Many thanks for that vbanoob. I also meant to ask in my first question how I would go about deleting the occurrences in between 1st and last (ie A5 and A10).

    Any help would be great?

    Regards

    Seamus

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe.

    Change delete to clearcontents if required

    Please Login or Register  to view this content.
    VBA Noob

  5. #5
    Forum Contributor SOS's Avatar
    Join Date
    01-26-2004
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    327
    Fantastic, vbanoob.

    With a tiny bit of tweaking and combining the code works perfectly.

    I may, of course, post again looking for further help with this project if I get stuck again.

    Many thanks again

    Seamus

+ 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