Skip to content

Instantly share code, notes, and snippets.

@ewancook
Last active February 9, 2018 18:54
Show Gist options
  • Save ewancook/fa9de016bea53ebfd63d679ddb7dd6bd to your computer and use it in GitHub Desktop.
Save ewancook/fa9de016bea53ebfd63d679ddb7dd6bd to your computer and use it in GitHub Desktop.
Sets mole fractions to 0 for blank cells without a specific number formatting (based on a guessed correlation)
Sub blanks()
Application.ScreenUpdating = False
Set xr = Worksheets("Sheet1")
For colNum = 1 To 19 Step 2
For Each c In xr.Range(xr.Cells(9, colNum), xr.Cells(56, colNum))
If IsEmpty(c) And c.Interior.ColorIndex = xlNone And c.Font.Bold = False Then
If c.NumberFormat <> "0.000" And c.Row <> 19 And c.Row <> 20 And c.Row <> 38 And c.Row <> 39 Then
c.Value = "0"
End If
End If
Next
Next
xr.Range("E14").Value = "0"
xr.Range("M13").ClearContents
Application.ScreenUpdating = True
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment