Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Oct 4, 12:15*pm, Mike H wrote:
Hi, Right click your sheet tab, view code and paste this in. the messagebox bit isn't necessary, it's to demonstrate the method Private Sub Worksheet_Change(ByVal Target As Range) MsgBox "Last changed cell was " & Target.Address Application.EnableEvents = False Cells(Target.Row, 2).Value = "Something" Application.EnableEvents = True End Sub Mike " wrote: Is it possible for VB to determine the last cell that was changed. I'm not referring to a cell changed by a macro, just a cell that was changed by typing into the cell. I want a macro to then update a cell in the same row, column B. Thanks- Hide quoted text - - Show quoted text - Mike, I've finally found some time to follow up on the suggestions in this string (Rick, I'll try your idea soon). For your suggestion I'm learning some more new stuff. I've never put code on a worksheet tab so I've got to understand that better. The message box indeed displays the cell just changed. That's cool! So now I have this Private Sub on a sheet (code) and my original macro1() on a module1 (code). I think the target.row will get updated everytime new data is entered in a cell. And your code went on to further enter something in column B of that row, but I don't want to update cell B just yet. I may have several cells in the row I want to change, and then when I am done invoke the macro, which first needs to check that it is in the right row, and then update the cell in column B. (The purpsoe of my original request was a form of an error check. When users enter data they can use the enter key or a tab key. In one case the active cell is left in the wrong row.) So, I think to use your method I need to understand how to pass the value of the target to my macro. is this possible? Did my description make any sense? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I need a formula to determine when the data was last changed | Excel Discussion (Misc queries) | |||
Determine if the sheet has been changed | Excel Programming | |||
determine if a cell changed value | Excel Worksheet Functions | |||
in vba what command is used to determine if a particular cell on a particular sheet changed? some kind of event? how to get the old and new value of the cell? | Excel Worksheet Functions | |||
How can I determine which cell changed as a result of a calculati. | Excel Worksheet Functions |