How to C# Socket Programming using Visual Studio.Net

Learn step by step network programming using C#.Net socket, remoting, WCF and SignalR technology from lots of source code and description. All source code download link available at end of the blog post.

Excel-VBA: Find Last Cell of Active WorkSheet

Hello here is the code

Public Function GetLastCellAddress() As String
    ' Variables
    Dim intCol As Integer
    Dim lngRow As Long
    Dim rUsedRange As Range
    Dim rCell As Range

    ' first unlock all cells
    Cells.Locked = False
    If WorksheetFunction.CountA(Cells) > 0 Then
        lngRow = Cells.Find(what:="*", After:=[A1], _
                            SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
        intCol = Cells.Find(what:="*", After:=[A1], _
                            SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
        Set rUsedRange = ActiveSheet.Range("$A$1" & ":" & Cells(lngRow, intCol).Address)
       
        lngRow = Cells.Find(what:="*", After:=[A1], _
                            SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
        intCol = Cells.Find(what:="*", After:=[A1], _
                            SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
        Set rUsedRange = ActiveSheet.Range("$A$1" & ":" & Cells(lngRow, intCol).Address)
        GetLastCellAddress = rUsedRange.Address
    End If
End Function

Labels: , , , , ,

leave a response