+ Reply to Thread
Results 1 to 9 of 9

How to show location of highlighted range at cell A1?

  1. #1
    Forum Contributor
    Join Date
    09-18-2011
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    375

    How to show location of highlighted range at cell A1?

    I have highlighted 3 separate ranges by mouse, say B12:B22, B25:B30, C33:C38

    How to show the range of the highlighted area by VBA at cell A1?

    i.e. Value of A1: B12:B22, B25:B30, C33:C38

  2. #2
    Valued Forum Contributor
    Join Date
    12-22-2015
    Location
    HK
    MS-Off Ver
    2010
    Posts
    532

    Re: How to show location of highlighted range at cell A1?

    Please Login or Register  to view this content.

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: How to show location of highlighted range at cell A1?

    I think Selection.Address(0, 0) would be simpler. You'd need to call it from a SelectionChange event.

  4. #4
    Forum Contributor
    Join Date
    09-18-2011
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    375

    Re: How to show location of highlighted range at cell A1?

    Thanks ikboy it's works.

    In practice, the location of range are highlighted by my VBA, instead of mouse.

    Upon using your VBA, the value of A1 is:
    B111:M165,B441:M495,B276:M330

    How to make it in order, i.e. value of A1 is revised to:
    B111:M165,B276:M330,B441:M495

  5. #5
    Valued Forum Contributor
    Join Date
    12-22-2015
    Location
    HK
    MS-Off Ver
    2010
    Posts
    532

    Re: How to show location of highlighted range at cell A1?

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    09-18-2011
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    375

    Re: How to show location of highlighted range at cell A1?

    Hi ikboy,

    As I want the result shows at cell B1, I revise your VBA from:
    Debug.Print Join(a, ",")
    to
    [b1].Value = Mid(s, 2)

    Upon my VBA highlight the following 3 areas:
    B111:M165,B386:M440,B221:M275

    Your VBA show the following at B1:
    386:M440

    Please revise your VBA so that the result is in order:
    B111:M165,B221:M275,B386:M440
    (order follows first cell of range, i.e. B111, B221, B386)

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: How to show location of highlighted range at cell A1?

    Please Login or Register  to view this content.

  8. #8
    Valued Forum Contributor
    Join Date
    12-22-2015
    Location
    HK
    MS-Off Ver
    2010
    Posts
    532

    Re: How to show location of highlighted range at cell A1?

    You should amend Debug.Print Join(a, ",") to [b1].Value = Join(a, ",")

  9. #9
    Forum Contributor
    Join Date
    09-18-2011
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    375

    Re: How to show location of highlighted range at cell A1?

    Thanks ikboy, jindon and rorya, it's work.

+ 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] Show Cell location or Row number in MSGBOX
    By crowmagnus in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-05-2017, 04:13 PM
  2. [SOLVED] Show location of copied cell.
    By Throughstream in forum Excel General
    Replies: 3
    Last Post: 04-04-2017, 09:46 AM
  3. [SOLVED] tracking cell to show value of a changing cell location
    By pratto in forum Excel General
    Replies: 5
    Last Post: 03-26-2017, 02:12 AM
  4. Show chart for highlighted cell
    By cloudwalking in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-27-2014, 06:27 AM
  5. Find MIN location, show cell next to it
    By canonelan2 in forum Excel General
    Replies: 2
    Last Post: 09-23-2008, 01:00 PM
  6. Replies: 0
    Last Post: 04-30-2005, 06:06 AM
  7. Highlighted cell jumping to cursor location
    By snowedin in forum Excel General
    Replies: 0
    Last Post: 01-19-2005, 06: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