View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
teylyn[_7_] teylyn[_7_] is offline
external usenet poster
 
Posts: 1
Default Dynamic range w/in formula in macro


Hi, I'm no VBA buff, but since the formula is essentially a text string,
you can just concatenate it with any other value, like


Code:
--------------------

stRow = InputBox("Which row are we interested in?")
Range("K11").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-9]C[-6]:R[" & stRow & "]C[-6],"""")"


--------------------


I may be completely off, but I'm sure I'll get corrected :)


--
teylyn

Teylyn -- 'teylyn.posterous.com' (http://teylyn.posterous.com)
------------------------------------------------------------------------
teylyn's Profile: 983
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=175466

Microsoft Office Help