referencing another sheet
Hi, James. The following code picks up a value from a cell on another
worksheet and displays it in a message box. It can be run from any
worksheet, and does not take you to the referenced sheet.
HTH
Ed
Sub Whats_This()
Dim strThis As String
strThis = Worksheets("Sheet1").Range("D9").Value
MsgBox strThis
End Sub
"James" wrote in message
ink.net...
Hello NG,
can someone please help me with problem in regards to referencing another
worksheet?
I have a worksheet called "log" which keeps track of the date the last
time
the workbook was modified.
I also have many worksheets for each month of the years, (i.e. jan2004,
feb2004, mar2004...).
What I would like to do is display a message showing the date the last
time
the workbook is modified.
I can get everything to work but I always end up on the log sheet, how can
I
sat on the current month's page and reference the Log sheet?
Any suggestions would be greatly appreciated.
Thanks
James
This works============================================= =======
Sub LastModified()
Dim datLastModified As Date
Dim datToday As Date
Dim intLastCell As Integer
datToday = Date
Application.ScreenUpdating = False
Worksheets("Log").Select
Range("=Log!A1").Select
ActiveCell.SpecialCells(xlLastCell).Select
datLastModified = ActiveCell.Value
ActiveCell.Offset(1, 0) = datToday
Application.ScreenUpdating = True
MsgBox "Last modified on: " & datLastModified, vbOKOnly, "Last Modified"
End Sub
|