I have the IsBold function as a module to use a formula in my workbook. Everytime i run another sub, the formula that uses the function throws an error. Is there any work around for this?
IsBold function:
Function IsBold(BoldRange As Range)
IsBold = BoldRange.Font.Bold
Application.Calculation = xlCalculationAutomatic
End Function
Other Subs that run and throw off IsBold function
Private Sub CommandButton1_Click()
LineStart = 6
LineEnd = 217
ColumnNumber = 2
For i = LineStart To LineEnd
If Cells(i, ColumnNumber).Value <> "Yes" Then
Cells(i, ColumnNumber).EntireRow.Hidden = True
Else
Cells(i, ColumnNumber).EntireRow.Hidden = False
End If
Next i
End Sub
Private Sub CommandButton2_Click()
Dim tbl As ListObject
Set tbl = Worksheets("Dynamics Data Load").ListObjects("Table1")
With tbl.DataBodyRange
If .Rows.Count > 1 Then
.Offset(1, 0).Resize(.Rows.Count - 1, .Columns.Count).Rows.Delete
End If
End With
tbl.DataBodyRange.Rows(1).SpecialCells(xlCellTypeConstants).ClearContents
End Sub
IsBold function:
Function IsBold(BoldRange As Range)
IsBold = BoldRange.Font.Bold
Application.Calculation = xlCalculationAutomatic
End Function
Other Subs that run and throw off IsBold function
Private Sub CommandButton1_Click()
LineStart = 6
LineEnd = 217
ColumnNumber = 2
For i = LineStart To LineEnd
If Cells(i, ColumnNumber).Value <> "Yes" Then
Cells(i, ColumnNumber).EntireRow.Hidden = True
Else
Cells(i, ColumnNumber).EntireRow.Hidden = False
End If
Next i
End Sub
Private Sub CommandButton2_Click()
Dim tbl As ListObject
Set tbl = Worksheets("Dynamics Data Load").ListObjects("Table1")
With tbl.DataBodyRange
If .Rows.Count > 1 Then
.Offset(1, 0).Resize(.Rows.Count - 1, .Columns.Count).Rows.Delete
End If
End With
tbl.DataBodyRange.Rows(1).SpecialCells(xlCellTypeConstants).ClearContents
End Sub