Right Hand Column on Screen

  • Thread starter Thread starter Tim Childs
  • Start date Start date
T

Tim Childs

Hi

Can someone give me the code snippet to give the column
number of the the column which is at the far right of the
screen itself i.e. the returned result will change if the
zoom factor of the display is changed.

Thanks

Tim
 
Tim,

Try something like the following

With ActiveWindow.VisibleRange
MsgBox .Cells(.Cells.Count).Column
End With


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
Sub FindColumn()
Dim rng As Range
Set rng = ActiveWindow.VisibleRange
Set rng = rng.Columns(rng.Columns.Count)
MsgBox rng.Address
End Sub
 
Back
Top