DataTable automatisch in Microsoft Excel exportiert

Heute möchte ich ein Beispiel, das mir serviert hat für eine lange Zeit und ich bin immer noch mit zu zeigen.
Wir werden ein Beispiel zu einer DataTable nach Excel voll unabhängig von der Anzahl der Spalten oder Zeilen, die Sie exportieren.

Mögen viele Wege dies zu tun, aber ich finde es wirklich sinnvoll, da diese Methode funktioniert für alle Versionen von Excel. Aus Gründen der Compatil mit neuen Versionen von Excel nur 256 Spalten verarbeiten.

Das erste, was wir brauchen, ist ein Verweis auf Microsoft.Office.Interop.Excel und wie folgt tun hinzu:

Importar referencia a Excel

Import Verweis auf Excel

Importar referencia Excel

Importieren von Excel-Verweis

Dann brauchen wir eine Form, eine Schaltfläche, ein DataGridView und ein Fortschrittsbalken. Wir können so in dem Bild zu sehen:

Formulario aplicación para exportar dataset a excel

Form-Anwendung auf Datensatz nach Excel exportieren

Jetzt möchte ich zeigen, den gesamten Code ist wirklich einfach das Wichtigste ist, dass es auf jeden Tisch passt. Ich werde in der Lage sein, ohne Probleme wieder verwendet werden.

 Importe Imports System.Data Imports System.Data.SqlClient Public Class Form1 Privat Microsoft.Office.Interop ds As New DataSet Private Sub Form1_Load (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load '/ / / /////////////////////////////////////////////// '/ / Wir schaffen die Verbindung und füllen Sie das DataGridView'////////////////////////////////////////// Dim cnn As New //////// SqlConnection ("Data Source = localhost \ SQLExpress; Initial Catalog = Northwind; Integrated Security = True") Dim da As New SqlDataAdapter ("Select * from customers", CNN) gibt. Fill (ds) DataGridView1.DataSource = ds.Tables (0) End Sub Private Sub btnExportar_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExportar.Click'/////////// ////////////////// '/ / Erstellen Sie das Excel-Objektmodell'//////////////////////// Dim Dim objLibroExcel ///// Dim objHojaExcel m_Excel m_Excel = CreateObject ("Excel.Application") m_Excel.Workbooks.Add objLibroExcel = () = objLibroExcel.Worksheets objHojaExcel (1) objHojaExcel.Name = "Kunden" objHojaExcel.Visible = Excel . XlSheetVisibility.xlSheetVisible objHojaExcel.Activate ()'//////////////////////////////////////// ///////////////// '/ / definieren zwei Variablen'///////////////////// Zeile und Spalte Kontrolle //////////////////////////////////// Dim Zeile As Integer = 1 Dim Spalte As Integer = 1 '/ //////////////////////////////////////////////// '/ / Wir setzen die Zeile mit den Spaltenüberschriften'//////////////////////////////////////// ///////// objHojaExcel.Range ("A1"). Select () For Each dc Im ds.Tables (0). Columns objHojaExcel.Range (ColumnName (Spalte) & 1). Value = dc.ColumnName + = 1 Spalte Next Zeile + = 1'//////////////////////////////////////// ///// '/ / Wir Format der Zeile Titel'//////////////////////////////// Als Excel.Range Dim objRango ///////////// = objHojaExcel.Range ("A1:". & ColumnName (ds.Tables (0) Columns.Count) & "1") objRango.Font . Bold = True objRango.Cells.Interior.ColorIndex = 35 objRango.Cells.Borders (Excel.XlBordersIndex.xlDiagonalDown). LineStyle = Excel.XlLineStyle.xlLineStyleNone objRango.Cells.Borders (Excel.XlBordersIndex.xlDiagonalUp). LineStyle = Excel. XlLineStyle.xlLineStyleNone objRango.Cells.Borders (Excel.XlBordersIndex.xlEdgeLeft). LineStyle = Excel.XlLineStyle.xlLineStyleNone objRango.Cells.Borders (Excel.XlBordersIndex.xlEdgeRight). LineStyle = Excel.XlLineStyle.xlContinuous objRango.Cells.Borders (Excel . XlBordersIndex.xlEdgeTop). LineStyle = Excel.XlLineStyle.xlContinuous objRango.Cells.Borders (Excel.XlBordersIndex.xlEdgeBottom). LineStyle = Excel.XlLineStyle.xlContinuous'//////////////// ////////////////////////// '/ / Lade alle Zeilen in der Datentabelle'////////////// //////////////////////////// ProgressBar1.Maximum = ds.Tables (0). Rows.Count ProgressBar1.Value column = 1 = 0 For Each dr In ds.Tables (0). Rows Spalte = 1 For Each dc In ds.Tables (0). objHojaExcel.Range Columns (ColumnName (Spalte) & Zeile). Value = dr (dc.ColumnName) Spalte + = 1 Nächste Zeile + = 1 + = 1 Next ProgressBar1.Value'//////////////////////////////////// / / '/ / Stellen Sie die Breite automatisch' / / für alle Spalten verwendet'//////////////////////////////// ////// objHojaExcel.Range objRango = ("A1:".. & ColumnName (ds.Tables (0) Columns.Count) & ds.Tables (0) Rows.Count.ToString) objRango.Select () objRango . Columns.AutoFit ()'///////////////////////////////////// '/ / tell '///////////////////////////////////// Display Excel MsgBox ("Export to Excel Complete" , MsgBoxStyle.Information ".:: solovb.net ::.") m_Excel.Visible = True End Sub Public Function ColumnName (ByVal Zahl As Integer) As String Dim Spalte (256) As String Column (1) =" A " Column (2) = "B"-Spalte (3) = "C"-Spalte (4) = "D"-Spalte (5) = "E"-Spalte (6) = "F"-Spalte (7) = "G"-Spalte ( 8) = "H"-Spalte (9) = "I"-Spalte (10) = "J"-Spalte (11) = "K"-Spalte (12) = "L"-Spalte (13) = Spalte "M" (14) = "N"-Spalte (15) = "O"-Spalte (16) = Spalte "P" (17) = "Q"-Spalte (18) = "R"-Spalte (19) = "S"-Spalte (20) = " T "-Spalte (21) =" U "-Spalte (22) =" V "-Spalte (23) =" W "-Spalte (24) =" X "-Spalte (25) =" Y "-Spalte (26) =" Z " Spalte (27) = "AA"-Spalte (28) = "AB"-Spalte (29) = "AC"-Spalte (30) = "AD"-Spalte (31) = "AE"-Spalte (32) = "AF"-Spalte ( 33) = "AG" Column (34) = "AH"-Spalte (35) = "AI"-Spalte (36) = "AJ"-Spalte (37) = "AK"-Spalte (38) = "TO"-Spalte (39) = "AM"-Spalte (40) = "AN"-Spalte (41) = "AO"-Spalte (42) = "AP"-Spalte (43) = "AQ"-Spalte (44) = "AR"-Spalte (45) = " AS "-Spalte (46) =" AT "-Spalte (47) =" AU "-Spalte (48) =" AV "-Spalte (49) =" AW "-Spalte (50) =" AX "-Spalte (51) =" AY " Spalte (52) = "AZ"-Spalte (53) = "BA"-Spalte (54) = "BB"-Spalte (55) = "BC"-Spalte (56) = "BD"-Spalte (57) = "BE"-Spalte ( 58) = "BF"-Spalte (59) = "BG"-Spalte (60) = "BH"-Spalte (61) = "BI"-Spalte (62) = "BJ"-Spalte (63) = "BK"-Spalte (64) = "BL"-Spalte (65) = "BM"-Spalte (66) = "BN" Kolonne (67) = "BO"-Spalte (68) = "BP"-Spalte (69) = "BQ"-Spalte (70) = " BR "-Spalte (71) =" BS "-Spalte (72) =" BT "-Spalte (73) =" BU "-Spalte (74) =" BV "-Spalte (75) =" BW "-Spalte (76) =" BX " Spalte (77) = "BY"-Spalte (78) = "BZ"-Spalte (79) = "CA"-Spalte (80) = "CB"-Spalte (81) = "CC"-Spalte (82) = "CD Spalte" ( 83) = "CE"-Spalte (84) = "CF"-Spalte (85) = "CG"-Spalte (86) = "CH"-Spalte (87) = "CI"-Spalte (88) = "CJ"-Spalte (89) = "CK"-Spalte (90) = "CL"-Spalte (91) = "CM"-Spalte (92) = "CN"-Spalte (93) = "CO"-Spalte (94) = "CP"-Spalte (95) = " CQ "-Spalte (96) =" CR "-Spalte (97) =" CS "-Spalte (98) =" CT "-Spalte (99) =" CU "-Spalte (100) =" CV "-Spalte (101) =" CW " Spalte (102) = "CX"-Spalte (103) = "CY"-Spalte (104) = "CZ"-Spalte (105) = "DA"-Spalte (106) = "DB"-Spalte (107) = "DC"-Spalte ( 108) = "DD"-Spalte (109) = "DE"-Spalte (110) = "DF"-Spalte (111) = "DG"-Spalte (112) = "DH"-Spalte (113) = Spalte "ID" (114) = "DJ"-Spalte (115) = "DK"-Spalte (116) = "DL"-Spalte (117) = "DM"-Spalte (118) = "DN"-Spalte (119) = "DO"-Spalte (120) = " DP "-Spalte (121) =" DQ "-Spalte (122) =" DR "-Spalte (123) =" DS "-Spalte (124) =" DT "-Spalte (125) =" DU "-Spalte (126) =" DV " Spalte (127) = "DW"-Spalte (128) = "DX"-Spalte (129) = "DY"-Spalte (130) = "DZ"-Spalte (131) = "EA"-Spalte (132) = "EB"-Spalte ( 133) = "EC"-Spalte (134) = "ED"-Spalte (135) = "EE"-Spalte (136) = "EF"-Spalte (137) = "EG"-Spalte (138) = "EH"-Spalte (139) = "EI"-Spalte (140) = "EJ"-Spalte (141) = "EK"-Spalte (142) = "EL"-Spalte (143) = "MS"-Spalte (144) = "IN"-Spalte (145) = " EO "-Spalte (146) =" EP "-Spalte (147) =" EQ "-Spalte (148) =" ER "-Spalte (149) =" ES "-Spalte (150) =" ET "-Spalte (151) =" EU " Spalte (152) = "EV"-Spalte (153) = "EW"-Spalte (154) = "EX"-Spalte (155) = "EY"-Spalte (156) = "EZ"-Spalte (157) = "FA"-Spalte ( 158) = "FB"-Spalte (159) = "FC"-Spalte (160) = "FD"-Spalte (161) = "FE"-Spalte (162) = "FF"-Spalte (163) = "FG"-Spalte (164) = "FH"-Spalte (165) = "FI"-Spalte (166) = "FJ"-Spalte (167) = "FK"-Spalte (168) = "FL"-Spalte (169) = "FM"-Spalte (170) = " FN "-Spalte (171) =" FOR "-Spalte (172) =" FP "-Spalte (173) =" CF "-Spalte (174) =" FR "-Spalte (175) =" FS "-Spalte (176) =" FT " Spalte (177) = "FU"-Spalte (178) = "FV"-Spalte (179) = "FW"-Spalte (180) = "FX"-Spalte (181) = "FY"-Spalte (182) = "FZ"-Spalte ( 183) = "GA"-Spalte (184) = "GB"-Spalte (185) = "GC"-Spalte (186) = "GD"-Spalte (187) = "GE"-Spalte (188) = "GF"-Spalte (189) = "GG"-Spalte (190) = "GH"-Spalte (191) = "GI"-Spalte (192) = "GJ"-Spalte (193) = "GK"-Spalte (194) = "GL"-Spalte (195) = " GM "-Spalte (196) =" GN "-Spalte (197) =" GO "-Spalte (198) =" GP "-Spalte (199) =" GQ "-Spalte (200) =" GR "-Spalte (201) =" GS " Spalte (202) = "GT"-Spalte (203) = "GU"-Spalte (204) = "GV"-Spalte (205) = "GW"-Spalte (206) = "GX"-Spalte (207) = "GY"-Spalte ( 208) = "GZ"-Spalte (209) = "HA"-Spalte (210) = "HB"-Spalte (211) = "HC"-Spalte (212) = "HD"-Spalte (213) = "HE"-Spalte (214) = "HF"-Spalte (215) = "HG"-Spalte (216) = "HH"-Spalte (217) = "HALLO"-Spalte (218) = "HJ"-Spalte (219) = "HK"-Spalte (220) = " HL "-Spalte (221) =" HM "-Spalte (222) =" HN "-Spalte (223) =" HO "-Spalte (224) =" HP "-Spalte (225) =" HQ "-Spalte (226) =" HR " Spalte (227) = "HS"-Spalte (228) = "HT"-Spalte (229) = "HU"-Spalte (230) = "HV"-Spalte (231) = "HW"-Spalte (232) = "H"-Spalte ( 233) = "HY"-Spalte (234) = "HZ"-Spalte (235) = "IA"-Spalte (236) = "IB"-Spalte (237) = "IC"-Spalte (238) = Spalte "ID" (239) = "IE"-Spalte (240) = "IF"-Spalte (241) = "IG"-Spalte (242) = "IH"-Spalte (243) = "II"-Spalte (244) = "IJ"-Spalte (245) = " IK "-Spalte (246) =" IL "-Spalte (247) =" IM "-Spalte (248) =" IN "-Spalte (249) =" IO "-Spalte (250) =" IP "-Spalte (251) =" IQ " Spalte (252) = "IR"-Spalte (253) = "IS"-Spalte (254) = "IT"-Spalte (255) = "UI"-Spalte (256) = "IV" Return Spalte (Anzahl) End Function End Class 

Diese Methode hat mir gute Dienste geleistet und ich hoffe, auch Sie ... Bitte hinterlassen Sie Ihre Kommentare.

26 Antworten zu "DataTable automatisch in Microsoft Excel exportiert"

  1. Bitacoras.com Information ...

    Rate in Bitacoras.com: Hallo: Heute möchte ich ein Beispiel, das mir serviert hat für eine lange Zeit und ich bin immer noch mit zu zeigen. Wir werden ein Beispiel zu einer DataTable nach Excel voll unabhängig von der Anzahl der Spalten oder Zeilen, die im Export ... ..

    • Carlos Linares sagt:

      Gut ...

      Ausgezeichnete Post! Vielen Dank hat mir geholfen, voll, aber ich habe eine große Frage .. Da diese Verbindung mit SQL .. Wie ändere ich den Namen der Spalten? Weil es bringt den Namen der Felder in SQL ..!

      Hoffen wir, dass ich verstanden habe ..

      Thank you!

  2. Denko sagt:

    Ich werde zu retten ...
    an einem gewissen Punkt wird es nützlich sein ...

  3. Victor sagt:

    Ist es gut für Excel 2007? Ich habe Probleme mit dem Export zu entwickeln, dass es gültig ist für ältere Versionen, aber nicht für 2007. Dank

  4. John sagt:

    Enorme Quellcode. hat mir gute Dienste. q es war längst überfällig.

  5. John sagt:

    Aber auch der Import von einer Datentabelle ecxel. ambien, konnte aber ein DataGrid und dann die Aktualisierung der DataAdapter und die Annahme der Änderungen, die wir zu retten wäre datatable in q bd ... Ich hoffe, ich kann helfen oder in der Lage sein zu finden .. Dank

  6. Jose sagt:

    Hallo Vielen Dank! großartig!
    Aber ich frage mich, welche angibt, dass Datagrid die Nutzung im Falle, die mehrere Datagrid werden?

    • Carlos Linares sagt:

      Aus der Tabelle, die Sie anrufen ...

      select * from (Tabellenname)

      Wenn Sie angeben möchten, welche Felder Sie

      wählen (Felder, Wiesen, Felder) * from table
      ejm
      Wählen Wagenfarbe, Anionen von Fahrzeugen

  7. beto sagte:

    Ich habe ein Problem mit diesem Beispiel, das ich machen 2 fM Fehler in Variablen und dr, kann ich es beheben?

    • Elisha sagt:

      Hallo, versuchen Sie dies:
      For Each dr As DataRow In ds.Tables (0). Zeilen und DataColumn For Each dc In ds.Tables als (0). Columns

      Ich hoffe, dass dieses Problem gelöst ist. Greetings.

  8. jason sagt:

    hallo.
    Diese Chevere, sondern Teil der Spaltenname nicht sehr funktionell.
    Ich werde auf meinem Blog eine viel kleinere Code-Größe Einschränkungen und ohne Upload

    jaysson.blogspot.com

  9. Rodrigo sagt:

    Guter Artikel, aber ich habe eine Problem auf meinem Rechner mit Excel 2007 funktioniert gut, aber Computer mit Excel 2003 oder früher wird nicht funktionieren. Wer weiß, ob das Problem von Bibliotheken, die importiert werden, wie Sie, das funktioniert für alle Excel verstehen geben, aber ich habe dieses Problem gestoßen.

    Mal sehen, ob jemand die Zweifel lösen können.
    Danke.

  10. Carlos Linares sagt:

    Gut ...

    Ausgezeichnete Post! Vielen Dank hat mir geholfen, voll, aber ich habe eine große Frage .. Da diese Verbindung mit SQL .. Wie ändere ich den Namen der Spalten? Weil es bringt den Namen der Felder in SQL ..!

    Hoffen wir, dass ich verstanden habe ..

    Thank you!

  11. Alexander sagt:

    Public Sub ExportarDatosExcel (ByVal DataGridView1 Wie DataGridView, ByVal Titel As String)
    As New Excel.Application Dim m_Excel
    m_Excel.Cursor = Excel.XlMousePointer.xlWait
    m_Excel.Visible = True
    Als Excel.Workbook Dim = m_Excel.Workbooks.Add objLibroExcel
    Als Excel.Worksheet Dim = objLibroExcel.Worksheets objHojaExcel (1)
    Mit objHojaExcel
    . Visible = Excel.XlSheetVisibility.xlSheetVisible
    . Activate ()
    'Header
    . Range ("A1: L1"). Merge ()
    . Range ("A1: L1"). Value = "Institut ARGENCAF"
    . Range ("A1: L1"). Font.Bold = True
    . Range ("A1: L1"). Font.Size = 15
    "Tuft
    . Range ("A2: L2"). Merge ()
    . Range ("A2: L2"). Value = title
    . Range ("A2: L2"). Font.Bold = True
    . Range ("A2: L2"). Font.Size = 12

    Const primeraLetra Wie Char = "A"
    Const firstNumber As Short = 3
    Dim Brief als Char, Char Wie UltimaLetra
    Dim Anzahl As Integer, UltimoNumero As Integer
    Dim As Byte = Asc cod_letra (primeraLetra) - 1
    Dim As String = Application.CurrentCulture.NumberFormat.NumberDecimalSeparator sepDec
    Dim As String = Application.CurrentCulture.NumberFormat.NumberGroupSeparator sepMil
    "Stellen Sie die Spalte Format der Tochter der Berechnung
    StrColumna Dim As String = ""
    LetraIzq Dim As String = ""
    Dim As Byte = Asc cod_LetraIzq (primeraLetra) - 1
    Letter = primeraLetra
    Number = firstNumber
    Als Excel.Range Dim objCelda
    For Each c In DataGridViewColumn In DataGridView1.Columns
    Dann, wenn c.Visible
    Wenn Letter = "Z" Dann
    Letter = primeraLetra
    cod_letra = Asc (primeraLetra)
    cod_LetraIzq + = 1
    LetraIzq = Chr (cod_LetraIzq)
    Sonst
    cod_letra + = 1
    Letter = Chr (cod_letra)
    End If
    strColumna = LetraIzq + Lyrics + Numero.ToString
    objCelda =. Range (strColumna, Type.Missing)
    objCelda.Value = c.HeaderText
    objCelda.EntireColumn.Font.Size = 8
    "ObjCelda.EntireColumn.NumberFormat = c.DefaultCellStyle.Format
    Wenn c.ValueType Ist GetType (Decimal) OrElse c.ValueType Ist GetType (Double) Then
    objCelda.EntireColumn.NumberFormat = "#" + sepMil + "0" + sepDec + "00"
    End If
    End If
    Nächste

    Als Excel.Range Dim objRangoEncab =. Range (primeraLetra + Numero.ToString, LetraIzq + Lyrics + Numero.ToString)
    objRangoEncab.BorderAround (a, Excel.XlBorderWeight.xlMedium)
    UltimaLetra = Senden
    Dim As String = LetraIzq UltimaLetraIzq

    "LOAD DATA
    Dim i As Integer = Anzahl + 1

    For Each in der Liste als DataGridViewRow DataGridView1.Rows
    LetraIzq = ""
    cod_LetraIzq = Asc (primeraLetra) - 1
    Letter = primeraLetra
    cod_letra = Asc (primeraLetra) - 1
    For Each c In DataGridViewColumn In DataGridView1.Columns
    Dann, wenn c.Visible
    Wenn Letter = "Z" Dann
    Letter = primeraLetra
    cod_letra = Asc (primeraLetra)
    cod_LetraIzq + = 1
    LetraIzq = Chr (cod_LetraIzq)
    Sonst
    cod_letra + = 1
    Letter = Chr (cod_letra)
    End If
    strColumna = LetraIzq + Lyrics
    "Burden hier sollte
    . Cells (i, strColumna) = IIf (IsDBNull (reg.ToString), "", reg.Cells (c.Index). Value)
    ". Cells (i, strColumna) = IIf (IsDBNull (reg. (c.DataPropertyName)), c.DefaultCellStyle.NullValue, reg (c.DataPropertyName))
    ". Range (strColumna + i, strColumna + i). In ()

    End If
    Nächste
    Als Excel.Range Dim objRangoReg =. Range (primeraLetra + i.ToString, i.ToString strColumna +)
    objRangoReg.Rows.BorderAround ()
    objRangoReg.Select ()
    i + = 1
    Nächste
    UltimoNumero = i

    "Zeichnen Sie die Linien der Spalten
    LetraIzq = ""
    cod_LetraIzq = Asc ("A")
    cod_letra = Asc (primeraLetra)
    Letter = primeraLetra
    For Each c In DataGridViewColumn In DataGridView1.Columns
    Dann, wenn c.Visible
    objCelda =. Reichweite (+ Lyrics + primerNumero.ToString LetraIzq, LetraIzq + Lyrics + (UltimoNumero -. 1) ToString)
    objCelda.BorderAround ()
    Wenn Letter = "Z" Dann
    Letter = primeraLetra
    cod_letra = Asc (primeraLetra)
    LetraIzq = Chr (cod_LetraIzq)
    cod_LetraIzq + = 1
    Sonst
    cod_letra + = 1
    Letter = Chr (cod_letra)
    End If
    End If
    Nächste

    "Zeichnen Sie die dicke äußere Grenze
    Als Excel.Range Dim objRango =. Range (primeraLetra + primerNumero.ToString, UltimaLetra UltimaLetraIzq + + (UltimoNumero -. 1) ToString)
    objRango.Select ()
    objRango.Columns.AutoFit ()
    objRango.Columns.BorderAround (1, Excel.XlBorderWeight.xlMedium)
    End With

    m_Excel.Cursor = Excel.XlMousePointer.xlDefault
    End Sub

    ToolStripButton2_Click_1 Private Sub (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
    ExportarDatosExcel (DataGridView1, "Export")
    End Sub

  12. JuanPeople sagt:

    EXCELLENT! .... Dank Bruder, hatte ich 3 Tage mit einem Modul für den Import / Export Excel und nichts funktionierte .... aber mit Ihrer Lösung sehe ich wieder die Sterne ... Grüße aus Arequipa !!!:..

  13. TECKNOCK sagt:

    Dieser Code mir sehr geholfen, so arbeite ich mit meinen zwei Cent:

    I optimiert das "ColumnName", um die Spalte ahsta ZZ bekommen (702 cols.)

    Hier gebe ich Ihnen den Code:

    Public Function ColumnName (ByVal Zahl As Integer) As String
    Dim Spalte (703) As String

    Column (1) = "A"
    Column (2) = "B"
    Spalte (3) = "C"
    Spalte (4) = "D"
    Spalte (5) = "E"
    Spalte (6) = "F"
    Spalte (7) = "G"
    Column (8) = "H"
    Spalte (9) = "I"
    Column (10) = "J"
    Column (11) = "K"
    Column (12) = "L"
    Column (13) = "M"
    Spalte (14) = "N"
    Column (15) = "O"
    Spalte (16) = "P"
    Spalte (17) = "Q"
    Column (18) = "R"
    Spalte (19) = "S"
    Column (20) = "T"
    Spalte (21) = "U"
    Spalte (22) = "V"
    Spalte (23) = "W"
    Spalte (24) = "X"
    Spalte (25) = "Y"
    Spalte (26) = "Z"

    Dim i = 27
    Für LTR1 = 1 bis 26
    Für Ltr2 = 1 bis 26
    Spalte (i) = Spalte (LTR1) & Spalte (Ltr2)
    i + = 1
    Nächste
    Nächste

    Return Spalte (Anzahl)
    End Function

    • Elisha sagt:

      TECKNOCK, ich danke Ihnen sehr für Ihre Hilfe!, Aber bedenken Sie, dass, wenn das Buch glaube ich, ist kompatibel mit Excel 97-2003 Spalten maximal zulässigen 256 (bis IV) ist. So wie ein Kommentar so berücksichtigen Sie dies.

      Elisha

  14. raysip sagt:

    Beim Ausführen der Anwendung lokal funcioana richtig, aber wenn ich auf eine Webseite gehen, erzeugt nicht die Excel-, aber nicht bekommen, Fehler

  15. Aderson sagt:

    anschaue, bin ich dabei von A bis meine sql GROUNDED

    Ich werde nicht gerne tun, aber aja estubo

  16. Paulus sagt:

    Ich brauche Hilfe versuchen, alle Formen, die hier zu tun und ich erhalte eine Fehlermeldung, alle

  17. John sagt:

    Hand, du bist die perfekte Funktion Maximum.

  18. neji sagt:

    sehr gut, herzlichen Glückwunsch in den besten Beitrag habe ich gelesen und habe konsultiert

  19. Patricia sagt:

    Thank you! Es war sehr hilfreich

Kommentar