Hi all
I'm trying to enter text (a staff members initials) into an Input Box so that the initials are then used as the citeria in a CountIF formula entered by VBA
A simplified version of the code I am using is:
The issue is getting the staffname string to be entered within the formula.
What is the correct combination of "" & to enable this to work.
Many thanks in advance for any advice offered.
I'm trying to enter text (a staff members initials) into an Input Box so that the initials are then used as the citeria in a CountIF formula entered by VBA
A simplified version of the code I am using is:
Dim staffname As String
staffname = InputBox(Prompt:="You name please.", _
Title:="ENTER INITIALS", Default:="MC")
Range("H9").FormulaR1C1 = "=COUNTIF(RC[-3]:RC[-1],"" & staffname & "")"
The issue is getting the staffname string to be entered within the formula.
What is the correct combination of "" & to enable this to work.
Many thanks in advance for any advice offered.