Get selected cell on sheet that is not the active sheet

J

joel

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

tianung

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
 
J

joel

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

Ryan H

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
 
J

john

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
 
Top