ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   In SelectionChange Make Last Rwo Dynamic (https://www.excelbanter.com/excel-programming/363984-selectionchange-make-last-rwo-dynamic.html)

Robert

In SelectionChange Make Last Rwo Dynamic
 
How can the end row be made dynamic as rows are inserted. I could name cell
A12001 as €œEND€ with the formula =ROW(A12000)

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Worksheets("GLOBAL").Rows("1:12000").Calculate
End Sub

Thank you.

--
Robert

Bob Phillips

In SelectionChange Make Last Rwo Dynamic
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim iRows As Long
iRows = Me.Cells(Me.Rows.Count,"A").End(xlUp).Row
Worksheets("GLOBAL").Rows("1:" & iRows).Calculate
End Sub

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Robert" wrote in message
...
How can the end row be made dynamic as rows are inserted. I could name

cell
A12001 as "END" with the formula =ROW(A12000)

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Worksheets("GLOBAL").Rows("1:12000").Calculate
End Sub

Thank you.

--
Robert




Robert

In SelectionChange Make Last Rwo Dynamic
 
Thank you Bob for your speedy assistance as always.
--
Robert





All times are GMT +1. The time now is 01:58 AM.

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