View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Last column in selection

You are correct, for Selectiuon it should be

With Selection
iCol = .Columns.Count + .Cells(1, 1).Column - 1
End With

--

HTH

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

"Norman Jones" wrote in message
...
Hi Bob,

I suspect that this (elegantly) returns the last column in the sheet

rather
than the selection.

---
Regards,
Norman Jones

"Bob Phillips" wrote in message
...
With ActiveSheet.UsedRange
iCol = .Columns.Count + .Cells(1, 1).Column - 1
End With



--

HTH

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

"Lawlera" wrote in message
...
Can anyone please help me with some code to return the column number

of
the last cell in a selected range?

TIA