SettingSave + SettingRead for NumberFormat

Reads or applies certain NumberFormat to cell in settings.
Same patterns as SettingRead, SettingSave and their custom versions.

CodeFunctionName
What is this?

Public

Tested

Original Work
Sub SettingSave_NumberFormat(SettingID, CellFormat)
    ' Number Format = "#" > Number | "@" > Text | "General" > General
    SettingSave_NumberFormat_Custom SettingID, CellFormat, , "Meta", "EA1"
End Sub
Function SettingRead_NumberFormat(SettingID)
    SettingRead_NumberFormat = SettingRead_NumberFormat_Custom(SettingID, , "Meta", "EA1")
End Function
Sub SettingSave_NumberFormat_Custom(SettingID, CellFormat, Optional WbData = "This", Optional ShData = "D", Optional A1Data = "A1")
    ' Number Format = "#" > Number | "@" > Text | "General" > General
    If WbData = "This" Then WbData = ThisWorkbook.Name
    CoCo1 = WorksheetFunction.CountIf(Workbooks(WbData).Worksheets(ShData).Range(A1Data).Offset(, 1).EntireColumn, SettingID)
    If CoCo1 = 0 Then Exit Sub
    NV = WorksheetFunction.Match(SettingID, Workbooks(WbData).Worksheets(ShData).Range(A1Data).Offset(, 1).EntireColumn, 0)
    Workbooks(WbData).Worksheets(ShData).Range(A1Data).Offset(NV - 1, 4).NumberFormat = CellFormat
End Sub
Function SettingRead_NumberFormat_Custom(SettingID, Optional WbData = "This", Optional ShData = "D", Optional A1Data = "A1")
    ' Number Format = "#" > Number | "@" > Text | "General" > General
    SettingRead_Format_Custom = "N/A"
    If WbData = "This" Then WbData = ThisWorkbook.Name
    CoCo1 = WorksheetFunction.CountIf(Workbooks(WbData).Worksheets(ShData).Range(A1Data).Offset(, 1).EntireColumn, SettingID)
    If CoCo1 = 0 Then Exit Function
    NV = WorksheetFunction.Match(SettingID, Workbooks(WbData).Worksheets(ShData).Range(A1Data).Offset(, 1).EntireColumn, 0)
    SettingRead_Format_Custom = Workbooks(WbData).Worksheets(ShData).Range(A1Data).Offset(NV - 1, 4).NumberFormat
End Function

SettingID, CellFormat
SettingID
SettingID, CellFormat, Optional WbData = "This", Optional ShData = "D", Optional A1Data = "A1"
SettingID, Optional WbData = "This", Optional ShData = "D", Optional A1Data = "A1"

Views 731

Downloads 59

CodeID
DB ID