Bernie, don't tell me you whipped that up just for li'l ol' me. Works fine.
Even goes on to stage 2, where we can begin and end anywhere. Good study
object, too, for range and selection.

But is there no global constant for last row or last column? What happens to
all the code when they expand the maximum range?

Thanks for the help.

rs

"Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
news:eI1919ETFHA.3620@TK2MSFTNGP09.phx.gbl...
: rs,
:
: Try the macro below.
:
: HTH,
: Bernie
: MS Excel MVP
:
: Sub IsolateRegion()
: If Selection(1, 1).Row <> 1 Then
: Range(Range("1:1"), Selection(0, 1)).EntireRow.Hidden = True
: End If
: If Selection(1).Column <> 1 Then
: Range(Range("A:A"), Selection(1, 0)).EntireColumn.Hidden = True
: End If
: If Selection(Selection.Cells.Count).Row <> 65536 Then
: Range(Range("65536:65536"), Selection.Item(Selection.Cells.Count) _
: .Offset(1, 0)).EntireRow.Hidden = True
: End If
: If Selection(Selection.Cells.Count).Column <> 256 Then
: Range(Range("IV:IV"), Selection.Item(Selection.Cells.Count) _
: .Offset(0, 1)).EntireColumn.Hidden = True
: End If
: End Sub
:
: "tcebob" <handle @ gwi.net> wrote in message
: news:OOydZjETFHA.612@TK2MSFTNGP12.phx.gbl...
: > Here's the plan:
: >
: > User highlights a region. For simplicity beginning at A1.
: > Suppose region is A1:i34.
: > User invokes macro IsolateRegion.
: > Macro selects all cols from J to end and hides them.
: > Macro selects all rows from 35 to end and hides them.
: > Done.
: >
: > Result: a page with no extraneous rows and columns.
: >
: > As I am not glib in Vbasic I hope you can offer a couple helps.
: > 1. [Range("J1:iV65536").Select] -- while awkward -- is possible. But
how
: > does one identify the beginning cell from the region A1:i34?
: > 2. is there a more general way to select to the end?
: >
: > Thanks
: > rs
: >
: >
:
: