Dim logSheet As Worksheet, folderSheet As Worksheet Dim lastLogRow As Long, lastCol As Long, lastFolderRow As Long Dim i As Long, j As Long, k As Long Dim folderPath As String, topFolderPath As String Dim folderName As String Dim targetName As String Dim accessRights As String