Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No question here, just a procedure for the archive.
Search critera: activate the last cell in a selection select last cell in range select last cell in selection activate last cell in range Sub SelectActivateLastCellInSelectedRange() 'Activates the last cell in the selected range but keeps the 'same range selected Dim LastRow As Variant Dim LastCol As Variant Dim TempRow As Variant Dim TempCol As Variant Dim LastCell As Range Dim A As Range LastRow = 1 LastCol = 1 ActiveWorkbook.Activate For Each A In Selection.Areas TempRow = A.Range("A1").Offset(A.Rows.Count - 1, 0).Row If TempRow LastRow Then LastRow = TempRow TempCol = A.Range("A1").Offset(0, A.Columns.Count - 1).Column If TempCol LastCol Then LastCol = TempCol Next A Set LastCell = Cells(LastRow, LastCol) LastCell.Activate End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert selected cell value into next cell in range that is empty | Excel Worksheet Functions | |||
Selecting the value from a randomly selected cell out of a range | Excel Discussion (Misc queries) | |||
How to get Total of Colored Cell in Selected Range | Excel Discussion (Misc queries) | |||
Activate cell at end of range | Setting up and Configuration of Excel | |||
Activate button when row selected. | Excel Programming |