ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   bottom right cell on screen (https://www.excelbanter.com/excel-programming/285713-bottom-right-cell-screen.html)

Stuart[_13_]

bottom right cell on screen
 
How can I get the bottom right cell that can be seen on the screen?



Rocky McKinley

bottom right cell on screen
 
'This will return the address of the visible cell in the bottom right hand
corner of the screen.
MsgBox
Range(ActiveWindow.VisibleRange.Address)(ActiveWin dow.VisibleRange.Count).Ad
dress

'or to select it ...
Range(ActiveWindow.VisibleRange.Address)(ActiveWin dow.VisibleRange.Count).se
lect

--
Regards,
Rocky McKinley


"Stuart" wrote in message
...
How can I get the bottom right cell that can be seen on the screen?





Rocky McKinley

bottom right cell on screen
 
It can have benifits in certain instances, "Step 2" for instance visits
every second cell in a range.

For t = 1 To Selection.Count Step 2
temp = Range(Selection.Address)(t).Value
Next t


--
Regards,
Rocky McKinley


"Stuart" wrote in message
...
Many thanks for that, I have never come across that bit of syntax before

Range(address)(cells in)

Therefor presumably the following could be used to step through a selected
range!

For t = 1 To Selection.Count
temp = Range(Selection.Address)(t).Value
Next t


I don't know if it would have any benifit over my usual

for each rng in selection
temp = rng.value
next rng

But interesting never the less



Rocky McKinley wrote in message
...
'This will return the address of the visible cell in the bottom right

hand
corner of the screen.
MsgBox


Range(ActiveWindow.VisibleRange.Address)(ActiveWin dow.VisibleRange.Count).Ad
dress

'or to select it ...


Range(ActiveWindow.VisibleRange.Address)(ActiveWin dow.VisibleRange.Count).se
lect

--
Regards,
Rocky McKinley


"Stuart" wrote in message
...
How can I get the bottom right cell that can be seen on the screen?









Stuart[_13_]

bottom right cell on screen
 
Many thanks for that, I have never come across that bit of syntax before

Range(address)(cells in)

Therefor presumably the following could be used to step through a selected
range!

For t = 1 To Selection.Count
temp = Range(Selection.Address)(t).Value
Next t


I don't know if it would have any benifit over my usual

for each rng in selection
temp = rng.value
next rng

But interesting never the less



Rocky McKinley wrote in message
...
'This will return the address of the visible cell in the bottom right hand
corner of the screen.
MsgBox

Range(ActiveWindow.VisibleRange.Address)(ActiveWin dow.VisibleRange.Count).Ad
dress

'or to select it ...

Range(ActiveWindow.VisibleRange.Address)(ActiveWin dow.VisibleRange.Count).se
lect

--
Regards,
Rocky McKinley


"Stuart" wrote in message
...
How can I get the bottom right cell that can be seen on the screen?







Tom Ogilvy

bottom right cell on screen
 
set rng = ActiveWindow.VisibleRange
rng(rng.rows.count,rng.columns.count).Select

--
Regards,
Tom Ogilvy

Stuart wrote in message
...
How can I get the bottom right cell that can be seen on the screen?






All times are GMT +1. The time now is 07:47 AM.

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