excel vba syntax dsum comparison with variable
Posted on 2013-01-24
Hello. I am trying, via Excel VBA to change a DSUM equality comparison utilizing a string variable. For instance, here is the current comparison.
Upon copying a new column I'd like the code to replace "Supplies" with a string variable named NewCategory. .
dim sNewCategory as string
sNewCategory = "Rent"
activecell.formula = "="" & NewCategory & """
Obviously, that example is wrong wrong wrong. I cannot figure out where to put the quotes at all.
Any help greatly appreciated and will speed up my current find/replace code that makes me nervous :)