Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
first and last cells of manually selected regions
I'm writing a script to be run on manually selected regions in
different worksheets in the same workbook. (I'll select one region at a time and then run the script.) How do I programmatically find the first and last cells (upper-left and bottom-right corners) of a manually selected region? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
first and last cells of manually selected regions
you can try these statements and see if they work for you selection.range("A1").address selection.specialcells(xlcelltypelastcell).address -- Gary "John Smith" wrote in message ... I'm writing a script to be run on manually selected regions in different worksheets in the same workbook. (I'll select one region at a time and then run the script.) How do I programmatically find the first and last cells (upper-left and bottom-right corners) of a manually selected region? Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
first and last cells of manually selected regions
Sub aaaa() Dim rng As Range Set rng = Selection.Cells If rng.Areas.Count 1 Then MsgBox "multiple selection" Else MsgBox rng(1).Address & vbCr & rng(rng.Count).Address End If Set rng = Nothing End Sub -- Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware (Excel Add-ins / Excel Programming) "John Smith" wrote in message I'm writing a script to be run on manually selected regions in different worksheets in the same workbook. (I'll select one region at a time and then run the script.) How do I programmatically find the first and last cells (upper-left and bottom-right corners) of a manually selected region? Thanks. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
first and last cells of manually selected regions
Are they single area ranges?
with selection msgbox .cells(1).address & vblf & .cells(.cells.count).address end with John Smith wrote: I'm writing a script to be run on manually selected regions in different worksheets in the same workbook. (I'll select one region at a time and then run the script.) How do I programmatically find the first and last cells (upper-left and bottom-right corners) of a manually selected region? Thanks. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to number cells (1,2,3...) w/o having to manually type them al | Excel Worksheet Functions | |||
manually selected Excel cell formatting | Excel Discussion (Misc queries) | |||
Multiple cells or columns are selected instead of selected cell or | Excel Discussion (Misc queries) | |||
Manually delete cells not being used at ends of workbook | Excel Discussion (Misc queries) | |||
Linked cells, make the data go hard manually | Excel Discussion (Misc queries) |