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
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
![]()
Please Login or Register to view this content.
I think Selection.Address(0, 0) would be simpler.You'd need to call it from a SelectionChange event.
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
![]()
Please Login or Register to view this content.
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)
![]()
Please Login or Register to view this content.
You should amend Debug.Print Join(a, ",") to [b1].Value = Join(a, ",")
Thanks ikboy, jindon and rorya, it's work.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks