Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Folks,
I have a set of data like this: 1 Dave 3 Matt 2 Bill 4 Steve I wanted to enter this data into an array, and assign it an address within that array based on the number associated with each name. Hence 1 = Dave, 2 = Bill etc. However the output seems to miss out the second data point. You end up with: 1 Dave 2 3 Matt 4 Steve Does data-entry into an array in VBA have to be sequential? The code I was using was: Sub test() Dim testname(4) For i = 1 To 4 testname(Cells(i, 1).Value) = Cells(i, 2).Value Cells(i, 3).Value = testname(i) Next i End Sub With the data in columns A and B in the spreadsheet. Appreciate it if someone can spot the problem. Cheers, Matt |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
transfering data in another column entering more sorted data | Excel Worksheet Functions | |||
Reading data arrays from multiple data files in excel | Excel Discussion (Misc queries) | |||
Data Access Efficiency: Arrays versus Worksheet Data | Excel Programming | |||
Working with ranges in arrays... or an introduction to arrays | Excel Programming | |||
Arrays - declaration, adding values to arrays and calculation | Excel Programming |