I am trying to use a variable as the number of times to repeat "." from the end of the text in a cell to the end of the cell width. When I hard wire a number like this:
cell.Formula = "=" & Chr(34) & cell.Value & Chr(34) & "& Rept(" & Chr(34) & "." & Chr(34) & ",150)"
the formula works perfectly.
No, that's an illusion. Make a new file, write "x" into A1 and run this code:
Sub Test()
Dim cell
Set cell = Range("A1")
cell.Formula = "=" & Chr(34) & cell.Value & Chr(34) & "& Rept(" & Chr(34) & "." & Chr(34) & ",150)"
End Sub

We get many more points than the cell is wide.
Furthermore, if we look into the XML file structure (what Excel saves on disk) we can this:
<sheetData>
<row r="1" spans="1:1" x14ac:dyDescent="0.25">
<c r="A1" t="str">
<f>"x"& REPT(".",150)</f>
<v>x......................................................................................................................................................</v>
</c>
</row>
</sheetData>
Unfortunately, determining the actual number of points we need for the width of a cell is very complicated and requires a lot of Windows API code.
From my view, your endeavor is questionable. Why do you want to do something like this?
Andreas.