Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50139

[SOLVED] "Call" using variable

$
0
0
I have a set of macros that are named the same except the names end in "01", "02" etcetera.
I want to call a specific one of them based on the last two digits of a cell, something like this:
Code:

Set rngFind2 = .Find(Bnum, .Cells(1, 1), LookIn:=xlValues, LookAt:=xlWhole)
    strText2 = rngFind2.Offset(-2, -2).Value
    reportNum2 = Right(strText, 2)
    CurRepNum = "newpage" & reportNum2
    Call CurRepNum

This returns "compile error: expected sub, function, or property." Is what I want to do possible? Much appreciation to anyone who can point me in the right direction!

Willardio

Viewing all articles
Browse latest Browse all 50139

Trending Articles