Formula in Macro

  • Thread starter Thread starter nc
  • Start date Start date
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)
 
bSub formulamacro()
Range("m1").Value = Application.Max(Sheets("sheet2").Columns(1))
Range("m2").Formula = "=max(sheet2!a:a)"
End Sub
 
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
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top