需要对逻辑进行审查。2 个工作簿(目前),每个工作簿有 5 个工作表。标记学校的主人与团队在 RC HH 导出下发现的案例 插入列以供饲养员与听者一起减轻过滤数据和精确匹配连接 为搜索源文件而建立的连接需要对 dst 文件执行匹配到 src 文件并填充 dst 文件CMR 以 src 文件形式提交,如果存在,则不会覆盖 dst 文件上 CMR 列中的任何现有数据,仅针对各个工作表上已使用的行的地址进行数据保护 src 和 dst 文件位于每个 Microsoft 的共享点,无法通过 vba 直接打开这些文件需要确保相应的文件在用户桌面上打开以运行此文件,并且在执行 Office 365 环境时没有其他用户登录
Sub Trial()
Dim src As String
Dim dst As String
Dim wbSource As Workbook
Dim wbDest As Workbook
Dim ALERT As String
Dim Concatenate As String
Dim FILLDATA As String
Dim SOURCE As String
Dim Head1 As String
Dim Head2 As String
Dim Check As Range
Dim r As Long
Dim lastrow2 As Long
Dim lastrow As Long
Dim N As Long
src = "RC_SCH_SORTED_TODAY.xlsx"
dst = "Copy Fall 2021_Schools_master list_8.24.21.xlsx"
ALERT = "ALERT-RC-Match"
Concatenate = "=RC[-47]&""-""&RC[-46]&""-""&RC[-45]"
Head1 = "FLAG FOR PULL FROM RC EXPORT"
Head2 = "Concatenated Search"
FILLDATAMS = "=XLOOKUP(@AX:AX,wbSource[[#RC SPARKS],[Concatenated Search]],wbDest[[#SPARKS],[CMR'#]],,0) "
FILLDATADC = "=XLOOKUP(@AX:AX,wbSource[[#RC DC],[Concatenated Search]],wbDest[[#DC],[CMR'#]],,0) "
FILLDATADR = "=XLOOKUP(@AX:AX,wbSource[[#RC Danielle],[Concatenated Search]],wbDest[[#Danielle],[CMR'#]],,0) "
FILLDATANC = "=XLOOKUP(@AX:AX,wbSource[[#RC Natalie],[Concatenated Search]],wbDest[[#Natalie],[CMR'#]],,0) "
FILLDATAGH = "=XLOOKUP(@AX:AX,wbSource[[#RC Gabe],[Concatenated Search]],wbDest[[#Gabe],[CMR'#]],,0) "
Set wbSource = Workbooks(src)
Set wbDest = Workbooks(dst)
Workbooks(src).Activate
Workbooks(dst).Activate
' sparks's team workload
Sheets("SPARKS").Select
Range("AW1").Value = Head1
Range("AX1").Value = Head2
Application.ScreenUpdating = False
lastrow = Worksheets("SPARKS").UsedRange.Rows.Count
N = Cells(Rows.Count, "C").End(x1Up).Row
Range("AX2:AX" & N).Formula2R1C1 = Concatenate
For r = lastrow To 2 Step -1
If Worksheets("SPARKS").Range("AF" & r).Value = "" Then
Worksheets("SPARKS").Cells("AF").Value = FILLDATAMS & Worksheets("SPARKS").Cells("AW") = ALERT
Else
End If
Next r
Application.ScreenUpdating = True
中断在 if/then 中的逻辑中,这在其他工作表中针对它们各自的来源重复,我被困在逻辑上。我没有接受过正式培训,但我的任务是解决这个问题。我有多个其他工作簿来执行类似的功能,以便将数据整合到支持团队。