View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default Capturing last column's letter

Not as bad as you thought Larry. Of course you don't actually need the
message box bit you can simply use the value returned in another routine.

Sub FindLastCol()
Dim LastColumn As Integer
If WorksheetFunction.CountA(Cells) 0 Then
LastColumn = Cells.Find(What:="*", After:=[A1], _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Column
MsgBox LastColumn
End If
End Sub


"LarryP" wrote:

A pesky little thing is eluding me. If I determine that the last used column
in a worksheet is, say, Worksheet.Columns(22), how can I convert that into
"V" so I can subsequently do things to Cell V1? I'm sure there must be some
nifty Property out there somewhere for this purpose, but darn if I've been
able to find it. Surely this isn't going to take some gawdawful Select Case
statement!