+ Reply to Thread
Results 1 to 12 of 12

How to Find ActiveCell Address on different sheet

  1. #1
    Forum Contributor
    Join Date
    06-28-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    115

    How to Find ActiveCell Address on different sheet

    Hi
    is there way to find out which cell is active on another sheet,
    like if I am sheet2, I want to know which cell is active on sheet1.

    I will use to write VBA code.

    If in Sheet1 Cell F4 is active than in Sheet2 A2 range will be IV4
    if in Sheet1 Cell F5 is active than in Sheet2 A2 range will be IV5
    and so on

    please please please help me do this

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How to Find ActiveCell Address on different sheet

    Please Login or Register  to view this content.
    E.g., in the Immediate window, with Sheet1 active,

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,351

    Re: How to Find ActiveCell Address on different sheet

    Hi zit1343,

    Three Pleases is a lot of begging. Here is some code that may be what you want. I turn off screen updatting, switch to Sheet1 and grab where the active cell is, then flip back to where I was. See if you can modify this code to get what you need.

    Please Login or Register  to view this content.
    It looks like shg and I did similar things. It looks like you have to flip to that window to get where the cell is.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Contributor
    Join Date
    06-28-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    115

    Re: How to Find ActiveCell Address on different sheet

    Hey
    thanks for help, I been trying to figure this out for many hours
    can you please explain me how to use it
    I am not understanding it
    thanks

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,351

    Re: How to Find ActiveCell Address on different sheet

    Hi,

    There is no way to directly, from sheet2, tell where the cursor will be when you tab back to Sheet1. What we do is use VBA code and flip back to Sheet1 without you seeing it. That is the ScreenUpdating part. Then we report back where the cursor is using the Row and Column of the ActiveCell. Then we flip back to where you were.

    Give us a sample of how you are needing or using the information and we can help more.

  6. #6
    Forum Contributor
    Join Date
    06-28-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    115

    Re: How to Find ActiveCell Address on different sheet

    Please see at attached file
    Sheet1 is the menu where user selects the item they want to pick
    if user select A041
    it will take you to sheet2 Cell A1,
    but they will still need to maunally select A041_Tag_Id from the drop down menu from sheet2
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    06-28-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    115

    Re: How to Find ActiveCell Address on different sheet

    Quote Originally Posted by shg View Post

    Please Login or Register  to view this content.
    what do you mean by this code
    I don't understand it

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How to Find ActiveCell Address on different sheet

    The VBE includes a window called Immediate; do Ctrl+G if it's not visible.

    Copy what I posted into the Immediate window and press Enter.

  9. #9
    Forum Contributor
    Join Date
    06-28-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    115

    Re: How to Find ActiveCell Address on different sheet

    here do I insert this code
    Function ActiveCellOnSheet(wks As Worksheet) As Range
    Dim wksOld As Worksheet

    Set wksOld = ActiveSheet
    Application.ScreenUpdating = False
    wks.Select
    Set ActiveCellOnSheet = ActiveCell
    wksOld.Select
    Application.ScreenUpdating = True
    End Function

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How to Find ActiveCell Address on different sheet

    In a standard code module.

  11. #11
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: How to Find ActiveCell Address on different sheet

    I wonder why there is not a way to do this without selecting the sheet. Obviously the active cell is stored somewhere within the file. Otherwise every time you navigate away from then back to the sheet (or close and re-open the file) the active cell would be A1 or something. Why do you suppose there isn't an easy/obvious way to retrieve this stored value?

  12. #12
    Forum Contributor
    Join Date
    06-28-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    115

    Re: How to Find ActiveCell Address on different sheet

    well after selecting the cell the data comes from another server, & I have over 10,000 items in those servers, and it can go up to 100,000 data for 1 single Cell eg A051, I wanna be able to dectect which one is clicked, if A051 is click than in Sheet2 wirte the tag name which belong to A051

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1