Hi, I'm new to MrExcel and hope I can bother someone for a few quick questions. Thank you in advance!!!!!!! I apologize if some of them are too easy, and/or too weird.
1) Suppose I simply want to count the number of times I execute any program:
Since the count displays 1 at the first run, is it fair to say that Counter is initialized at zero?
2) For
I can probably replace "Sheet1" with 1. Is this good practice?
3) Suppose I want to check if a group of cells all have formulas.
So if A1 has a formula, and A2 doesn't, "Mixed!" is displayed. But for some reason, if I want to display or print true/false (i.e. both cells have formulas or don't have), I need to say MsgBox FormulaTest. This is all right with me, but although it works, it apparently has a run-time error.
Apparently, VBE says that the Variant can only return a Null, not a value. Assuming I understood that, is there a proper alternative to display true/false/mixed?
Thanks again :>
1) Suppose I simply want to count the number of times I execute any program:
Code:
Static Counter As Integer
Dim Msg As String
Counter = Counter + 1
Msg = "Number of executions: " & Counter
2) For
Code:
MsgBox Worksheets("Sheet1").Range("F3").Column
3) Suppose I want to check if a group of cells all have formulas.
Code:
'apparently FormulaTest as Boolean isn't a good idea'
Dim FormulaTest As Variant
FormulaTest = Worksheets("Sheet2").Range("A1:A2").HasFormula
If TypeName(FormulaTest) = "Null" Then MsgBox "Mixed!"
Apparently, VBE says that the Variant can only return a Null, not a value. Assuming I understood that, is there a proper alternative to display true/false/mixed?
Thanks again :>