View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
filo666 filo666 is offline
external usenet poster
 
Posts: 265
Default How to ask VB for the last cell modified???

last cell changed.............
Tks tim, I'll try with your suggestion
TKS both of you

"Jim Thomlinson" wrote:

I am assuming that you do not mean last row or column but rather the last
cell that was changed. Is this going to be sheet specific or is this in the
workbook in general. If is is sheet specific then you need to declare a sheet
level variable and update it based on the sheet on change event for the
sheet. If you mean for the book in general then you probably want to access
the thisworkbook on change event and store both the sheet and the cell.

Sheet Specific...
Private LastCellChanged As Range

Private Sub Worksheet_Change(ByVal Target As Range)
Set LastCellChanged = Target
End Sub

Global...
Public g_LastCellChanged As Range
Public g_LastSheetChanged As Range

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Set g_LastSheetChanged = Sh
Set g_LastCellChanged = Target
End Sub


--
HTH...

Jim Thomlinson


"filo666" wrote:

My macro:
sub minusculas()
"LAST CELL MODIFIED"=ucase("LAST CELL MODIFIED")
end sub