View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Auric__ Auric__ is offline
external usenet poster
 
Posts: 538
Default Difference in value of a cell in Excel at two different time.

I wrote:

Sub compare()
Dim monday As Workbook, sunday As Workbook, target As Worksheet
Set target = ActiveSheet
Set monday = Workbooks.Open("D:\Monday 00-01.xlsx", ReadOnly:=True, _
AddToMru:=False)
Set sunday = Workbooks.Open("D:\Sunday 11-59.xlsx", ReadOnly:=True, _
AddToMru:=False)
target.Range("A1").Value = sunday.ActiveSheet.Range("A1").Value - _
monday.ActiveSheet.Range("A1").Value
monday.Close
sunday.Close
Set monday = Nothing
Set sunday = Nothing
End Sub


I forgot to mention, replace "A1" in target with the cell you want the
results placed in, and replace "A1" in sunday and monday with the address of
the source data.

--
You people have the morals of guinea pigs!