ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get selected cell on sheet that is not the active sheet (https://www.excelbanter.com/excel-programming/437552-get-selected-cell-sheet-not-active-sheet.html)

joel[_354_]

Get selected cell on sheet that is not the active sheet
 

I can't seem to get the address of the selected cell that is not on the
activesheet. Anybody know how to do this in 2003?


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=163314

Microsoft Office Help


tianung[_2_]

Get selected cell on sheet that is not the active sheet
 
On Dec 18, 1:49*am, joel wrote:
I can't seem to get the address of the selected cell that is not on the
activesheet. *Anybody know how to do this in 2003?


Let's say you have a sheet named "Sheet3" and you want the E4 cell in
this sheet to have the text "Joel". This can be achieved as follows:

Sheets("Sheet3").Cells(4, 5).Value = "Joel"

HTH

joel[_356_]

Get selected cell on sheet that is not the active sheet
 

Please read the question better, your answer isn't even close to
answering the question.


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=163314

Microsoft Office Help


Ryan H

Get selected cell on sheet that is not the active sheet
 
The worksheet that you want the active cell address has to be active. So
activate the sheet first then you can get your active cell. For example,

Sheets("Sheet1").Activate
MsgBox ActiveCell.Address

or you can loop thru all the sheets in your workbook and find all the active
cells.

Sub FindSelectedCell()

Dim wks As Worksheet

For Each wks In Worksheets
.Activate
MsgBox ActiveCell.Address
Next wks

End Sub
--
Cheers,
Ryan


"joel" wrote:


I can't seem to get the address of the selected cell that is not on the
activesheet. Anybody know how to do this in 2003?


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=163314

Microsoft Office Help

.


John

Get selected cell on sheet that is not the active sheet
 
To get the last active cell of an inactive sheet you need to make that sheet
active You can can try something along these lines:

Sub ActiveCellOnSheet2()

Dim ActCell As Range
Dim LastCell As Range

Set ActCell = ActiveCell

With Application

.ScreenUpdating = False

Worksheets(2).Activate

Set LastCell = ActiveCell

.Goto ActCell

.ScreenUpdating = True

End With

MsgBox ActCell.Address(0, 0) & Chr(10) & LastCell.Address(0, 0)

End Sub


--
jb


"joel" wrote:


I can't seem to get the address of the selected cell that is not on the
activesheet. Anybody know how to do this in 2003?


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=163314

Microsoft Office Help

.



All times are GMT +1. The time now is 10:20 AM.

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