NamedRange.AutoFill(Range, XlAutoFillType) Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Secara otomatis mengisi sel dalam NamedRange kontrol.
public object AutoFill (Microsoft.Office.Interop.Excel.Range Destination, Microsoft.Office.Interop.Excel.XlAutoFillType Type = Microsoft.Office.Interop.Excel.XlAutoFillType.xlFillDefault);
abstract member AutoFill : Microsoft.Office.Interop.Excel.Range * Microsoft.Office.Interop.Excel.XlAutoFillType -> obj
Public Function AutoFill (Destination As Range, Optional Type As XlAutoFillType = Microsoft.Office.Interop.Excel.XlAutoFillType.xlFillDefault) As Object
Parameter
- Destination
- Range
Sel yang akan diisi. Tujuan harus menyertakan rentang sumber.
- Type
- XlAutoFillType
Menentukan jenis isian. Bisa menjadi salah satu nilai iniXlAutoFillType: xlFillDaysxlFillSeriesxlGrowthTrendxlFillMonthsxlLinearTrendxlFillWeekdaysxlFillFormatsxlFillDefaultxlFillValuesxlFillCopyxlFillYearsJika argumen ini atau dihilangkanxlFillDefault, Microsoft Office Excel memilih tipe isian yang paling sesuai, berdasarkan rentang sumber.
Mengembalikan
Contoh
Contoh kode berikut mengatur nilai 5 dalam sel A1, lalu menggunakan AutoFill metode untuk mengisi sel A1 hingga A20 secara otomatis dengan nilai dalam sel A1.
Contoh ini untuk kustomisasi tingkat dokumen.
private void SetAutoRange()
{
Microsoft.Office.Tools.Excel.NamedRange namedRange1 =
this.Controls.AddNamedRange(this.Range["A1"],
"namedRange1");
namedRange1.Value2 = 5;
namedRange1.AutoFill(this.Range["A1", "A20"],
Excel.XlAutoFillType.xlFillDefault);
}
Private Sub SetAutoRange()
Dim namedRange1 As Microsoft.Office.Tools.Excel.NamedRange _
= Me.Controls.AddNamedRange(Me.Range("A1"), _
"namedRange1")
namedRange1.Value2 = 5
namedRange1.AutoFill(Me.Range("A1", "A20"), _
Excel.XlAutoFillType.xlFillDefault)
End Sub
Keterangan
Parameter Opsional
Untuk informasi tentang parameter opsional, lihat Parameter Opsional di Solusi Office.