| VBA-Beispiel 089 | |
|
|
|
zweidimensionales Array |
|
| zweidimensionales Array mit Zellwerten anlegen | |
|
Option Explicit Option Base 1 Private Sub zweidimensionales_Array() Dim astrNamen() As String Dim lngZeile As Long, lngLZ As Long Dim intSpalte As Integer lngLZ = Cells(Rows.Count, 1).End(xlUp).Row ReDim astrNamen(lngLZ, 2) For lngZeile = 1 To lngLZ For intSpalte = 1 To 2 astrNamen(lngZeile, intSpalte) = Cells(lngZeile, intSpalte) Next intSpalte Next lngZeile For lngZeile = LBound(astrNamen) To UBound(astrNamen) MsgBox astrNamen(lngZeile, 1) & " " & astrNamen(lngZeile, 2) Next lngZeile Erase astrNamen End Sub |
|
|
Download: vba089.zip |
|
|
relevante Links: |
|
| |