Erste leere Zeile finden, dann darauf schreiben

Ich muss die erste leere Zeile in einer Arbeitsmappe finden und Informationen in (Zeile, 1) und (Zeile, 2) schreiben. Ich denke ich stecke momentan ziemlich fest ...

Function WriteToMaster(num, path) As Boolean

'Declare variables
Dim xlApp As Excel.Application
Dim wb As Workbook
Dim ws As Worksheet
Dim infoLoc As Integer

Set xlApp = New Excel.Application

Set wb = xlApp.Workbooks.Open("PATH OF THE DOC")
Set ws = wb.Worksheets("Sheet1")

'Loop through cells, looking for an empty one, and set that to the Num
Cells(1, 1).Select
For Each Cell In ws.UsedRange.Cells
    If Cell.Value = "" Then Cell = Num
    MsgBox "Checking cell " & Cell & " for value."
Next


'Save, close, and quit
wb.Save
wb.Close
xlApp.Quit

'Resets the variables
Set ws = Nothing
Set wb = Nothing
Set xlApp = Nothing

Vielen Dank für jede Hilfe.

Antworten auf die Frage(8)

Ihre Antwort auf die Frage