0
次のように私は知っていますFormulaArray
は長い行です。それは私が `IFERROR()」せずに式を記述する場合、それは動作しますRun-time error '1004': Unable to set the FormulaArray property of the Range class
Arrayformulaにエラーが表示されます。rangeクラスのformulaarrayプロパティを設定できません
Private Sub CommandButton2_Click()
Dim x As Variant
Dim y As Variant
Workbooks.Open (TextBox3.Text)
x = Split(TextBox2.Value, Application.PathSeparator)
y = Split(TextBox3.Value, Application.PathSeparator)
Workbooks(x(UBound(x))).Sheets("KomponentenohneDuplikate").Activate
Workbooks(x(UBound(x))).Sheets("KomponentenohneDuplikate").Range("y5").FormulaArray = "=iferror(INDEX('[" & y(UBound(y)) & "]Regelung&Partno'!C1:C10,MATCH(1,('[" & y(UBound(y)) & "]Regelung&Partno'!C5=RC[-24])*('[" & y(UBound(y)) & "]Regelung&Partno'!C9=""DC""),0),10),""-"")"
With Workbooks(x(UBound(x))).Sheets("KomponentenohneDuplikate").Range("y5:y3263")
.FillDown
.Value = .Value
End With
を示しているのでしかし、私はこの問題を解決する方法がわかりません。これは以下のコードです。
Workbooks(x(UBound(x))).Sheets("KomponentenohneDuplikate").Range("y5").FormulaArray = "=INDEX('[" & y(UBound(y)) & "]Regelung&Partno'!C1:C10,MATCH(1,('[" & y(UBound(y)) & "]Regelung&Partno'!C5=RC[-24])*('[" & y(UBound(y)) & "]Regelung&Partno'!C9=""DC""),0),10)"
しかし、私の式の問題点は、一致がシート'[" & y(UBound(y)) & "]Regelung&Partno'
で発見されていない場合、それは「#N/A」エラーを返すということです。だから私はIfError()
関数で数式を追加したい。しかし、それは動作しません
私はこれを解決する方法を助けてください。
こんにちは、同じ 'FormulAarray'では、私は関数' IFNA() 'を使いました。それは今働く。しかし、実行は遅かった。私は、ファイル2( ''["&y(UBound(y))]の~900.000までのファイル1( 'Workbooks(x(UBound(x))) & "] Regelung&Partno'')。この式をもっと速く動かす方法はありますか? –
しかし、私の次の同様の数式はまだ動作していません。私は '.Replace'メソッドを使用しました。しかし、同じエラーが再び表示されます。 Dim FormulaPart1 As String Dim FormulaPart2 As String FormulaPart1 = "= ifna(INDEX( '["&y(UBound(y))& "] Regelung&Partno'!C1:C10、part2,0)、10) ( "["&y "(UBound(y))&"] ")"FormulaPart2 = "= MATCH(1、 ( "z5") ワークシート(x(U)))ワークシート( "KomponentenohneDuplikate")。.FormulaArray = FormulaPart1 。 "part2"、FormulaPart2、xlPartを置換する 最後に –