VBA Codes for Tally Users

VBA Codes for Example no. 1

Function GetFormat(Cell As Range) As String
GetFormat = Cell.NumberFormat
End Function

VBA Codes for Example no. 2

Sub CleanTallyData()

'   Created by Rishabh Pugalia

Dim rng As Range
Set rng = Selection

For Each Cell In rng
        If InStr(1, Cell.NumberFormat, "Cr") > 0 Then
        Cell.Value = Cell.Value * -1
        Else
        Cell.Value = Cell.Value
        End If
        
        Cell.NumberFormat = "General"
Next
End Sub

VBA Codes for Example no. 3

Function GetComments(pRng As Range) As String

'Source: www.extendoffice.com/documents/excel/765-excel-convert-comments-to-cells.html

If Not pRng.Comment Is Nothing Then
    GetComments = pRng.Comment.Text
End If
End Function