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
 

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