Selection

  • Thread starter Thread starter Robin Clay
  • Start date Start date
R

Robin Clay

This doesn't work :[

It grinds to a halt on the penultimate line.
I suspect that the last line also would not work.

Dim myRow1 As Long, myCol1 As Long
Dim myRow2 As Long, myCol2 As Long
myRow1 = Selection.Row
myCol1 = Selection.Column
myRow2 = Selection.End(xlDown).Row
myCol2 = Selection.End(xlRight).Column
Range(myRow1 & myCol1 & ":" & myRow2 & myCol2).Select


Please help ?


RClay AT haswell DOT com
 
Robin,

try this

Dim myRow1 As Long, myCol1 As Long
Dim myRow2 As Long, myCol2 As Long
myRow1 = Selection.Row
myCol1 = Selection.Column
myRow2 = Selection.End(xlDown).Row
myCol2 = Selection.End(xlToRight).Column
Range(Cells(myRow1, myCol1), Cells(myRow2, myCol2)).Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top