ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to make sure a Cell is within the current visible window's ran (https://www.excelbanter.com/excel-programming/334357-how-make-sure-cell-within-current-visible-windows-ran.html)

OKLover[_2_]

How to make sure a Cell is within the current visible window's ran
 
as Title

Tom Ogilvy

How to make sure a Cell is within the current visible window's ran
 
set rng = Activesheet.Range("Z21")
if intersect(rng,ActiveWindow.VisibleRange) is nothing then
Application.GoTo rng, true
End if

--
Regards,
Tom Ogilvy


"OKLover" wrote in message
...
as Title




Chip Pearson

How to make sure a Cell is within the current visible window's ran
 
Please put the question in the body of the message, not the
subject line. Subject lines get truncated.
Try code like the following:


If Not Application.Intersect(ActiveWindow.VisibleRange, _
ActiveCell) Is Nothing Then
MsgBox "Visible"
Else
MsgBox "Not Visible"
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"OKLover" wrote in message
...
as Title





All times are GMT +1. The time now is 05:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com