Placing a Variable Properly

  • Thread starter Thread starter Dennis
  • Start date Start date
D

Dennis

Hi, I'm trying to get the rr variable syntax to work. I tried putting it in ()
and preceding it by & and $ and I cant get it to work. Any hep would be
appreciated.

Tia, Dennis


Sub Countif()
Dim r As String
Dim rr As Variant
Range("L1").Select
rr = Application.InputBox("Enter where to count, 11 = A, 10 = B.....")
ActiveCell.FormulaR1C1 = "=COUNTIF(C[-rr)],RC[-rr])"
r = Application.InputBox("Enter a Range L1 Thru ?", "L1:")
Selection.AutoFill Destination:=Range(r), Type:=xlFillDefault
Range("A1").Select
End Sub
 
Back
Top