BradleyS
Active Member
- Joined
- Oct 28, 2006
- Messages
- 333
- Office Version
- 2010
- Platform
- Windows
This formula works fine:
Range("D25").Formula = "=""Corrected = ""&COUNT(5b!A:A)&""" & Chr(10) & "TPP = 8035"""
However, the numeric value at the end "8035" should be a variable rather than hard text, but I just can't get the formula to work in the cell when I try to change it to a variable.
The below doesn't work, and I have tried all sorts of combinations with the quotes, but obviously not the correct one, so any help here would be most appreciated
Dim TotalPP as Integer
TotalPP = 8035
Range("D25").Formula = "=""Corrected = ""&COUNT(5b!A:A)&""" & Chr(10) & "TPP = "" & TotalPP
Range("D25").Formula = "=""Corrected = ""&COUNT(5b!A:A)&""" & Chr(10) & "TPP = 8035"""
However, the numeric value at the end "8035" should be a variable rather than hard text, but I just can't get the formula to work in the cell when I try to change it to a variable.
The below doesn't work, and I have tried all sorts of combinations with the quotes, but obviously not the correct one, so any help here would be most appreciated
Dim TotalPP as Integer
TotalPP = 8035
Range("D25").Formula = "=""Corrected = ""&COUNT(5b!A:A)&""" & Chr(10) & "TPP = "" & TotalPP