View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default Applicaion.Selection on Excel

Hi Rahul

Put this code on the codesheet for ThisWorkbook, and make sure that
CellAddress is pointing to an unused cell.

Const CellAddress As String = "A1000"
Private Sub Workbook_BeforeClose(Cancel As Boolean)
For Each sh In ThisWorkbook.Sheets
Range("A1000") = Selection.Address
Next
End Sub

Private Sub Workbook_Open()
For Each sh In ThisWorkbook.Sheets
sel = Range("A1000").Value
Range(sel).Select
Next
End Sub

Regards,

Per

"RV" skrev i meddelelsen
...

Is there any other way of getting the selected range on the individual
sheets of workbook after the workbook is opened. The reason is
workbook/worksheet must be storing this last selected ranges. So whenever
we
switch between the sheets the last selected ranges is shown. So from this
perspective, is there a way to get it.

With Warm Regads,

-Rahul Vakil