Placing a Variable Properly

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
 

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

Top