I know that my english can be better. Please rate my work and not my lack in linguistic skills!

If you find any kind of ownership issue, or you think some content is your property. Please be so kind and contact me, i will remove or solve it ASAP.

You like my free Uploads and want to support me, than please donate here:

Basic

Dim LastRow As Long

Dim objExcelWbk As Microsoft.Office.Interop.Excel.Workbook
Dim objExcelsht As Microsoft.Office.Interop.Excel.Worksheet
Dim objExcelApp As Application = System.Runtime.InteropServices.Marshal.GetActiveObject("Excel.Application")

 

        With objExcelsht
            While objExcelsht.Cells(rw, 2).value IsNot Nothing
                Dim test As String = objExcelsht.Cells(rw, 2).value.ToString
                rw = rw + 1
            End While
            LastRow = rw - 1
        End With

Targetcell (the first write-able cell farest right)

Dim tgtcolm As Integer 
Dim tgtcell As String
Dim LstBaseColm As Integer       

'----------------------------------  searching tgtcolm -------------------------------
        tgtcell = objExcelsht.Cells(1, 1).Value
        While tgtcell <> ""
            tgtcolm = tgtcolm + 1
            tgtcell = objExcelsht.Cells(1, tgtcolm).Value
        End While
        LstBaseColm = tgtcolm
        'tgtcolm = tgtcolm + 1

Dim LastRwColm As String

LastRwColm = objExcelsht.Cells(dumparrlCnt, tgtcolm + 1).Address(RowAbsolute:=False, ColumnAbsolute:=False)