Advertisement

07.18.2008 at 08:36AM PDT, ID: 23577198
[x]
Attachment Details

how can I find sheets(i).selection.address WITHOUT using Activate  method

Asked by rberke in Microsoft Excel Spreadsheet Software

Sub t()
' how can I find sheets(i).selection.address WITHOUT using Activate method?
' Currently, I Activate  the sheet, get the selection.address, then Activate my original sheet.
' It is a minor problem, but I find it annoying.

' Here are examples that demonstrate several attempts that don't work


' example #1 works, but it uses the Activate method
For i = 1 To Sheets.count
Sheets(i).Activate
Debug.Print Selection.Address
Next i

' example #2 doesn't abort, but it doesn't work. For obvious reasons, it always reports the active sheet's address.
For i = 1 To Sheets.count
Debug.Print Sheets(i).Application.Selection.Address
Next i

' example #3 gives "object doesn't support this property or method". This is because Selection is a property of the application, NOT the workbook or the worksheet.
For i = 1 To Sheets.count
Debug.Print Sheets(i).Selection.Address
Next i


End Sub
Start Free Trial
[+][-]07.18.2008 at 08:39AM PDT, ID: 22036974

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 08:42AM PDT, ID: 22037011

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Excel Spreadsheet Software
Sign Up Now!
Solution Provided By: spattewar
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.18.2008 at 08:46AM PDT, ID: 22037058

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 08:47AM PDT, ID: 22037066

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 08:48AM PDT, ID: 22037079

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 08:51AM PDT, ID: 22037104

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 08:57AM PDT, ID: 22037158

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.18.2008 at 09:16AM PDT, ID: 22037391

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 09:19AM PDT, ID: 22037416

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 09:19AM PDT, ID: 22037417

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 09:21AM PDT, ID: 22037436

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 12:54PM PDT, ID: 22039219

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 12:59PM PDT, ID: 22039258

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628