Alright, here is a bigger picture.
Code:
Sub Name()
Dim xlApp As New Excel.Application
Dim wb As Excel.Workbook
Dim ws As Excel.Worksheet
Set ws = wb.Sheets("Sheet1")
Set wb = xlApp.Workbooks.Open("MySpreadsheet.xlsx")
With ws
.Range("A1:D1").Interior.Color = RGB(216, 228, 188)
.Cells.Font.Name = "Calibri"
.Cells.Font.Size = 8
.Cells(1, 4).NumberFormat = "0.00%" ' This is the cell I want to show as a %,
.Columns("C").HorizontalAlignment = xlLeft
End With
Do Until Cows_Come_Home = True
'Code does a lot of stuff here.
'Code checks for confirmation here
'Code then updates excel here
mathS = RowNum / LastRow
ws.Cells(1, 4) = "Percent Complete: %" & mathS
'Code does tons of other stuff here
Loop
msgbox "Moo"
End Sub
As you can see I don't really want to set the cell .numberformat, because I also want to pass text into the cell.
I've tried doing this.
Code:
.Cells(1, 4).NumberFormat = "0.00%"
Code:
mathS = RowNum / LastRow
CleanPerc = Format(mathS "@.@@")
ws.Cells(1, 4) = "Percent Complete: %" & CleanPerc
And a host of other things that I've found online.
This is the list of outputs I'm getting from the code at the top of this post.
Code:
Percent Complete: %9.04977375565611E-03
Percent Complete: %1.35746606334842E-02
Percent Complete: %1.80995475113122E-02
Percent Complete: %2.26244343891403E-02
Percent Complete: %2.71493212669683E-02
Percent Complete: %3.16742081447964E-02
Percent Complete: %3.61990950226244E-02
Percent Complete: %4.07239819004525E-02
Percent Complete: %4.52488687782805E-02
Percent Complete: %4.97737556561086E-02
Percent Complete: %5.42986425339367E-02
Percent Complete: %5.88235294117647E-02
Percent Complete: %6.33484162895928E-02
Percent Complete: %6.78733031674208E-02
Percent Complete: %7.23981900452489E-02
Percent Complete: %7.69230769230769E-02
Percent Complete: %0.081447963800905
Percent Complete: %0.085972850678733
Percent Complete: %9.04977375565611E-02
Percent Complete: %9.50226244343891E-02
Percent Complete: %9.95475113122172E-02
Percent Complete: %0.104072398190045 ' It should be around 10% here, 200ish totalrows on this attempt
Percent Complete: %0.108597285067873
Percent Complete: %0.113122171945701
Percent Complete: %0.117647058823529
Percent Complete: %0.122171945701357
Percent Complete: %0.126696832579186
Percent Complete: %0.131221719457014
Percent Complete: %0.135746606334842
Percent Complete: %0.14027149321267
Percent Complete: %0.144796380090498
Percent Complete: %0.149321266968326
Percent Complete: %0.153846153846154
Percent Complete: %0.158371040723982
Percent Complete: %0.16289592760181
Percent Complete: %0.167420814479638
Percent Complete: %0.171945701357466
Percent Complete: %0.176470588235294
Percent Complete: %0.180995475113122
Percent Complete: %0.18552036199095
Percent Complete: %0.190045248868778
Percent Complete: %0.194570135746606
Percent Complete: %0.199095022624434
Percent Complete: %0.203619909502262
Percent Complete: %0.208144796380091
Percent Complete: %0.212669683257919
Percent Complete: %0.217194570135747
Percent Complete: %0.221719457013575
Percent Complete: %0.226244343891403
Percent Complete: %0.230769230769231
Percent Complete: %0.235294117647059
Percent Complete: %0.239819004524887
Percent Complete: %0.244343891402715
Percent Complete: %0.248868778280543
I'm at a loss.