OaklandJim
Well-known Member
- Joined
- Nov 29, 2018
- Messages
- 833
- Office Version
- 365
- Platform
- Windows
Array specialists
I apologize for asking a question that has probably been asked a million times but I've forgotten how to use a 2d array. I tried looking at stuff on the internet but cannot quite get it right. Hopefully pseudocode below shows what I'm trying to do. For my attempt to redim excel tells me that the array is already dimensioned. I'd really appreciate your assistance.
I apologize for asking a question that has probably been asked a million times but I've forgotten how to use a 2d array. I tried looking at stuff on the internet but cannot quite get it right. Hopefully pseudocode below shows what I'm trying to do. For my attempt to redim excel tells me that the array is already dimensioned. I'd really appreciate your assistance.
VBA Code:
Option Base 1
Sub LoadArray()
Dim asPeople(6, 1) As String
asPeople(1, 1) = "First Name"
asPeople(2, 1) = "Last Name"
asPeople(3, 1) = "Email"
asPeople(4, 1) = "Phone"
asPeople(5, 1) = "Shift"
asPeople(6, 1) = "Notes"
ReDim Preserve asPeople(6, 2)
asPeople(1, 2) = "Bill"
asPeople(2, 2) = "Ding"
asPeople(3, 2) = "bill@email.com"
asPeople(4, 2) = "555 234 5678"
asPeople(5, 2) = "First"
asPeople(6, 2) = "Good experience"
ReDim Preserve asPeople(6, 3)
asPeople(1, 3) = "Bill"
asPeople(2, 3) = "Dupp"
asPeople(3, 3) = "bdupp@email.com"
asPeople(4, 3) = "444 234 5678"
asPeople(5, 3) = "Second"
asPeople(6, 3) = "No experience"
End Sub