View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Unable to populate a range with a formula

SetAC2 is a function and need the parethesis

Range("AC2:AC10").Formula = "=SetAC2()"

"MichaelDavid" wrote:

Greetings! This one has me stumped. I am trying to populate a range with a
formula. The code is:

Sub TestSetAC2()
Range("AC2:AC10").Formula = "=SetAC2"
Exit Sub
End Sub

Function SetAC2()
SetAC2 = 5
End Function

First I opened a blank worksheet. When I execute the procedure, I get #Name?
thruout the range. The tool tip just to the left of #Name? says that the
formula contains unrecognized text. Any help will be greatly appreciated.
--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick