Я хотел бы использовать эту сложную формулу в VBA, однако я все время получаю сообщение об ошибке: «Описание» - это одно из имен заголовков из моей таблицы, не могли бы вы мне помочь?Спасибо.
Теперь он показывает две ошибки, расширил таблицу до самого дна и ошибку 1004
Sub StartChecking()
'Spacing Check and Auto Correct
ActiveSheet.Range("O6").Formula = "=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(SUBSTITUTE(DVDQC_Log[@Description], ""/"", "" / "")), ""C / O"", ""C/O""), "" -"", ""-""), ""- "", ""-"")"
Columns("O:O").EntireColumn.AutoFit
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Range("F6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
Application.CutCopyMode = False
'Pass or Fail Check
ActiveSheet.Range("P6").Formula = "=IF([DVDQC_Log[@Needed Revisions]]="", ""PASSED"", ""FAILED"")"
Columns("I:I").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$I1<>$P1"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent2
.TintAndShade = 0.399945066682943
End With
Selection.FormatConditions(1).StopIfTrue = False
Range("DVDQC_Log[[#Headers],[Notes]]").Select
Selection.Copy
Range("DVDQC_Log[[#Headers],[Pass/Fail]]").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Application.CutCopyMode = False
ActiveWorkbook.Names.Add Name:="Address_ID", RefersToR1C1:= _
"=DVDQC_Log[Address_ID]"
ActiveWorkbook.Names("Address_ID").Comment = ""
Columns("N:N").Select
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=LEN(TRIM(N1))=0"
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent2
.TintAndShade = 0.399945066682943
End With
Selection.FormatConditions(1).StopIfTrue = False
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Range("A6").Select
End Sub