View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default why won't this work???

One way:

Dim here As Double
here = ActiveCell.Offset(0, -7).Value
ActiveCell.FormulaArray = "=sumif(b1:b1000," & here & ",h1:h1000)/168"

Notice: Dim as double; FormulaArray

HTH

"Office_Novice" wrote:

This shoud do it

Sub fourteenftauto()
Dim i As Variant

i = ActiveCell.Offset(0, -7).Value

ActiveCell = "=sumif(b1:b1000," & i & " ,h1:h1000)/168"

End Sub




"Zab" wrote:

i tried it and it did not work. :-( but hey thanks for the quick response
and nice try.
--
Zab


"Mike H" wrote:

Try this

Sub fourteenftauto()
Dim here As String
Range("here") = ActiveCell.Offset(0, -7).Value
ActiveCell = "=sumif(b1:b1000,here,h1:h1000)/168"
End Sub

Mike

"Zab" wrote:

i have a macro that won't insert the value from the offset. it just inserts
the word "here". i need the value from "here"

Sub fourteenftauto()
Dim here As String
here = ActiveCell.Offset(0, -7).Value
ActiveCell = "=sumif(b1:b1000,here,h1:h1000)/168"
End Sub
--
Thank You in advance, Zab