Formula in Macro

N

nc

Using I would like to make a value of a cell equal to a Excel function of a
range.

Example:

Sheet 1 Cell A1 = Sheet 2 max of range (A:A)
 
D

Don Guillett

bSub formulamacro()
Range("m1").Value = Application.Max(Sheets("sheet2").Columns(1))
Range("m2").Formula = "=max(sheet2!a:a)"
End Sub
 
N

nc

Don

Thanks a lot for your help.



Don Guillett said:
bSub formulamacro()
Range("m1").Value = Application.Max(Sheets("sheet2").Columns(1))
Range("m2").Formula = "=max(sheet2!a:a)"
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software
[email protected]
 
Top