Usage example

Sub TestffC()

    Dim NextCol As Long
    NextCol = ffC(shData)

    Debug.Print NextCol

End Sub

Function Code

'*************************************
'Return first free column in sheet sh
'*************************************
Function ffC(sh As Worksheet) As Long
    ffC = sh.Range("A1").CurrentRegion.Columns.Count + 1
End Function

The function ffC is part of My Common Library: My Common Library (1508 downloads )

Similar Posts