Formulas Are Showing

ScottInTexas

Board Regular
Joined
Oct 28, 2003
Messages
178
My spreadsheet is showing formulas in some of the cells. I type in a formula and it appears as though it was text even though it starts with=. Also the format of the cell is "General." Actually, there are 600 cells showing the formulas. But while I kept messing with the cells one or two of them began showing properly. I made sure that Application.ScreenUpdating was true. I made sure that the Display setting was correct and I made sure the cell format was general. Is there anything else I can do?
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Make sure that your Calculation is set to manual and that the show formulas check box isn't checked.

Both are under the Formula tab.
 
Last edited:
Upvote 0
Thank you Mark858. I had made sure that Show Formulas was unchecked and Calculation were set to Automatic. What I ended up doing was to write a short sub to run back through all the cells and re-write the formula and set the format to General. I sat and watched as the formulas disappeared. I don't know why it did it in the first place.
Code:
Public Sub FixC2AndB2Sections()
Dim i, j, shtNo, intRow, intCol As Integer
Dim wksht As Worksheet


intRow = 44
intCol = 4
shtNo = 1
Set wksht = Sheets("Structures1")


For i = 1 To 50
    If i = 26 Then
        intRow = 45
        intCol = 4
        shtNo = 2
        Set wksht = Sheets("Structures2")
    End If
    
    For j = 0 To 5
        intRow = intRow + 1
        wksht.Cells(intRow, intCol).formula = _
            "=IF(" & StripDollars(wksht.Cells(intRow - 16, intCol).address) & "<>" & Chr(34) & Chr(34) & ", " & _
            StripDollars(wksht.Cells(intRow - 16, intCol).address) & "," & Chr(34) & Chr(34) & ")"
        wksht.Cells(intRow, intCol).NumberFormat = "General"
        wksht.Cells(intRow, intCol).Locked = True
    Next
    intRow = 52
    For j = 0 To 5
        intRow = intRow + 1
        wksht.Cells(intRow, intCol).formula = _
            "=IF(" & StripDollars(wksht.Cells(intRow - 16, intCol).address) & "<>" & Chr(34) & Chr(34) & ", " & _
            StripDollars(wksht.Cells(intRow - 16, intCol).address) & "," & Chr(34) & Chr(34) & ")"
            wksht.Cells(intRow, intCol).NumberFormat = "General"
            wksht.Cells(intRow, intCol).Locked = True
    Next
    intRow = 44
    intCol = intCol + WIDTH_OF_STRUCTURES
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top