我正在尝试通过以下方式修复丢失的条目
- 找到它然后
- 将相对于找到的条目的最左侧单元格值复制到另一个工作表的第一个空底部单元格。
With Worksheets("Paste Pivot").Range("A1:AZ1000")
Dim source As Worksheet
Dim destination As Worksheet
Dim emptyRow As Long
Set source = Sheets("Paste Pivot")
Set destination = Sheets("User Status")
Set c = .Find("MissingUserInfo", LookIn:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
'Here would go the code to locate most left cell and copy it into the first empty bottom cell of another worksheet
emptyRow = destination.Cells(destination.Columns.Count, 1).End(xlToLeft).Row
If emptyRow > 1 Then
emptyRow = emptyRow + 1
End If
c.End(xlToLeft).Copy destination.Cells(emptyRow, 1)
c.Value = "Copy User to User Status worksheet"
Set c = .FindNext(c)
If c Is Nothing Then Exit Do
Loop While c.Address <> firstAddress
End If
End With