Assistance with a function applying to multiple worksheets

Copper Contributor

Hello!

I recently added a function that helps me track the last Cell I modified In my Timecard Worksheet:

=CELL("address")

It tells me the last column and row that I entered data into making it easier to track. The problem is, It works on all my worksheets in that workbook, which means if I enter something in my other worksheet: Data entry. The =CELL("address") cell in Timecard responds to that input in Timecard. Resulting in me losing my place. If there is some way for me to restrict a function to one worksheet I haven't been able to find it in my search. Hopefully I explained it well enough! 

Open for alternative solutions as well. Thanks.

6 Replies

@StickyVES Yes, without providing a reference =CELL("address",A1), it will return the address of the active cell regardless.  If you put in a reference the sheet name will be retained. 

 

 

So A1 (or whichever cell I need it for), should be helping keep track of the cell I edit in a single sheet? It just makes it continually reference whichever cell I enter in the function and won't track my other entries.

People appear to have the opposite issue than me it seems. They have trouble making functions work over multiple sheets. I can't get that code to stop referencing the other sheets. Even if I could get the last cell I modified change color or something, Then clear it when I enter something else.
Someone said I should just put the name of the worksheet "Timecard" But I don't know where in the function to place it. =CELL("address").

@StickyVES

What you want is not possible using the CELL function:

  • In the form =CELL("address") it will return the address of the active cell, on whichever sheet is the active sheet.
  • In the form =CELL("address",A1) or =CELL("address",Timecard!A1) it will return A1 instead of the address of the active cell.

You might use VBA code to store the address of the last used cell on the Timecard sheet in a cell, but that has the undesirable side effect of disabling Undo on the Timecard sheet...

I have a nasty habit of finding problematic issues like this. Thanks very much for the help!

@StickyVES 

 

There may be another way, depending on how that Timecard worksheet is laid out, and whether or not the final cell is always in the same column. I have a couple of worksheets in which I find it convenient to know what the last row is.

I use a formula like this:  =COUNTA($A$7:$A$10000)

I know column A has some text in it in every row until the last one, so the count gives me the row number. (For now, the fact that it's limited to 10,000 max gives plenty of margin, but that number is arbitrary.)

It would be fairly easy to construct a cell reference, knowing that piece of information, if you always are using the same column for your last entry in Timecard