I am trying to insert this formula into a dynamic range, and I cannot get the last formula to enter as I keep getting a Data Mismatch error message. I think this is because I am getting lost in the quotation marks for all of the interior functions. Any advice on how to get this formula to post into the cells?
Dim lastrowI As Range, lastrowJ As Range, lastrowK As Range
Set lastrowI = Range("H300").End(xlUp).Offset(0, 1)
Set lastrowJ = Range("H300").End(xlUp).Offset(0, 2)
Set lastrowK = Range("H300").End(xlUp).Offset(0, 3)
Range("I4", lastrowI).Value = "=MIN(ROUNDUP(G4/$I$1,0)*$I$1,$K$1)"
Range("J4", lastrowJ).Value = "=I4-$I$1+1"
Range("k4", lastrowK).Value = "=IF(G4=0,""0-Current"",IF(G4>$K$1,TEXT($K$1,0)" & "" + " ,TEXT(J4,0)" & "" - "" & "TEXT(I4,0)))"