Hi
I want to use the following code so that the active cell is populated with the formular =COUNTIF(M2:M" & rowCount & ", "" * "")
Sub Macro1()
Dim theRange As String
Dim rowCount As Integer
rowCount = rowCount + 10 ' Set rowcount
theRange = "M" & rowCount
Range(theRange).Select
ActiveCell.FormulaR1C1 = "=COUNTIF(M2:M" & rowCount & ", "" * "")"
With ActiveCell.Characters(Start:=1, Length:=8).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 12
.ColorIndex = xlAutomatic
End With
End Sub
Unfortunately I get the following result. =COUNTIF('M2':'M40', " * ")
Close, however no cigar!!! How do I get rid of the quotes around the M2 & M40??
I want to use the following code so that the active cell is populated with the formular =COUNTIF(M2:M" & rowCount & ", "" * "")
Sub Macro1()
Dim theRange As String
Dim rowCount As Integer
rowCount = rowCount + 10 ' Set rowcount
theRange = "M" & rowCount
Range(theRange).Select
ActiveCell.FormulaR1C1 = "=COUNTIF(M2:M" & rowCount & ", "" * "")"
With ActiveCell.Characters(Start:=1, Length:=8).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 12
.ColorIndex = xlAutomatic
End With
End Sub
Unfortunately I get the following result. =COUNTIF('M2':'M40', " * ")
Close, however no cigar!!! How do I get rid of the quotes around the M2 & M40??