ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to ask VB for the last cell modified??? (https://www.excelbanter.com/excel-programming/340738-how-ask-vbulletin-last-cell-modified.html)

filo666

How to ask VB for the last cell modified???
 
My macro:
sub minusculas()
"LAST CELL MODIFIED"=ucase("LAST CELL MODIFIED")
end sub


Chip Pearson

How to ask VB for the last cell modified???
 
What do you mean by "last modified"? Do you mean most recently,
or the last row and column modified?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"filo666" wrote in message
...
My macro:
sub minusculas()
"LAST CELL MODIFIED"=ucase("LAST CELL MODIFIED")
end sub




Jim Thomlinson[_4_]

How to ask VB for the last cell modified???
 
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


filo666

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


filo666

How to ask VB for the last cell modified???
 
Hey, could some of you chek 11 discution below, the one "3 unanswered
questions, 1......"
I really need help with these questions
Tanks

"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



All times are GMT +1. The time now is 05:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com