Writing data to an Array - Array Help

VenturSum

Board Regular
Joined
May 23, 2010
Messages
137
Hi all,

I'm still getting used to working with arrays and could use a bit of guidance.

---
I want to store up to 16 values in a 1 dimension array.
These will be column names: "A", "Z", "CC" et cetera.

---
I'm defining the array as:
Dim ArrCol(1 To 16) As String


The column names are from a combo box on a user form
and I need some way to add the data to the array.

If ComboBox01.Value <> "" Then
>> Add Data to array <<
End If


any thoughts if I'm doing this correctly or better??

Thank you,

John,
In Annapolis, MD
 

Some videos you may like

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Firefly2012

Well-known Member
Joined
Dec 28, 2011
Messages
3,638
Hi John

There's nothing wrong with what you have. How are you keepng track of the array elements you have populated (eg a counter perhaps from 1 to 16)?
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,675
Office Version
  1. 2010
Platform
  1. Windows
Ignore... I misread the question.
 
Last edited:

VenturSum

Board Regular
Joined
May 23, 2010
Messages
137
Firefly,

I figure it out just as I give up and ask !!
go figure.

Here is how I'm adding the data:
If cbx01.Value <> "" Then ArrCol(1) = VBA.UCase$(cbx01.Value)
If cbx02.Value <> "" Then ArrCol(2) = VBA.UCase$(cbx02.Value)


Thank you,
John
 

Watch MrExcel Video

Forum statistics

Threads
1,122,262
Messages
5,595,161
Members
413,972
Latest member
emiguy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top