I'm looking to create a macro that will perform a "countif" function in a separate worksheet, to end up with a frequency distribution. As my macro is currently written, the "countif" formula depends on this particular column being in the same place every time in the Raw Data worksheet, but this isn't exactly a reasonable assumption. I'd like the macro to be able to *find* the column first and then refer to that specific location in the formula.

Here's what I have right now:

Sheets("RawData").Select
Range("A1").Select
Cells.Find(What:="ColName", After:=ActiveCell, LookIn:=xlFormulas, _
        LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
        MatchCase:=True, SearchFormat:=False).Activate
VarCol = ActiveCell.Column
        
'Frequency Distribution
Sheets("Frequencies").Select
    Range("B4").Select 'This is where I plan to put the first value of the frequency distribution
    ActiveCell.FormulaR1C1 = _
        "=COUNTIF('RawData'!C[VarCol],""=Value1"")+COUNTIF('RawData'!C[VarCol],""=Value2"")+COUNTIF('RawData'!C[VarCol],""=Value3"")"
Of course, this doesn't work. Basically, I'm trying to get it to where the text that appears in the formula for the column reference (the "C[]" part of the formula) to use the column value that's returned in the "find" code above it. How do you refer to a variable name to act as a column reference within a function?

Any help would be appreciated. Thanks!