ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VisibleRange addresses to Array (https://www.excelbanter.com/excel-programming/411969-visiblerange-addresses-array.html)

Giff

VisibleRange addresses to Array
 
Does anyone know of a way to input the address of each cell in the
visible range (I've been using ActiveWindow.VisibleRange as a test)
into an array?

Gary''s Student

VisibleRange addresses to Array
 
Sub liminal()
n = ActiveWindow.VisibleRange.Count
Dim ar() As String
ReDim ar(n) As String
i = 0
For Each r In ActiveWindow.VisibleRange
ar(i) = r.Address
i = i + 1
Next
End Sub

--
Gary''s Student - gsnu2007i


"Giff" wrote:

Does anyone know of a way to input the address of each cell in the
visible range (I've been using ActiveWindow.VisibleRange as a test)
into an array?


Bob Phillips

VisibleRange addresses to Array
 
Dim aryAddresses As Variant

aryAddresses =
ActiveWindow.VisibleRange.SpecialCells(xlCellTypeV isible).Address


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Giff" wrote in message
...
Does anyone know of a way to input the address of each cell in the
visible range (I've been using ActiveWindow.VisibleRange as a test)
into an array?





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

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