Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I can't figure out what you are after. The syntax
If () = True Then is not valid. It gives a compiler error: Expected: Expression What is it you are trying to compare, and with what? As far as adding results to an empty array, you have two different ways to create the array. One is Dim X(1 to 10) As Variant The other is Dim X AS Variant: Redim X(1 to 10) With the 2nd syntax, you can write X = Array(1,2,3,4,5,6,7,8,9,10) With the 1st it has to be X(1) = 1: X(2) = 2, etc. On Wed, 28 Jul 2004 18:54:11 -0700, "a" wrote: Given the basic structure below, anyone know how to add the results (10 of them) from the If...Then statements inside the For Next loop to an empty array ? --------------------------------------------------------------------- For i = 1 to 10 If ()= True Then cvtVariable = "Text" ElseIf ()= True Then cvtVariable = "Number" ElseIf ()= True Then cvtVariable = "Error" Else cvtVariable = "Blank" End If Next i ----------------------------------------------------------------------- Dim cvt1 As String Dim cvt2 As String Dim cvt3 As String Dim cvt4 As String Dim cvt5 As String Dim cvt6 As String Dim cvt7 As String Dim cvt8 As String Dim cvt9 As String Dim cvt10 As String Dim CellValueTestVariableArray As String Dim cvtVariable As String CellValueTestVariableArray = Array(cvt1, cvt2, cvt3, cvt4, cvt5, cvt6, cvt7, cvt8, cvt9, cvt10) ------------------------------------------------------------------- The result would look something like this, for example: cvt1 = "Text" cvt2 = "Blank" cvt3 = "Error" cvt4 = "Number" cvt5 = "Number" cvt6 = "Blank" cvt7 = "Number" cvt8 = "Text" cvt9 = "Error" cvt10 = "Text" ------------------------------------------------------------------ Thanks, Paul |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Assign Values to array | Excel Discussion (Misc queries) | |||
Assign Cell Values without a Loop | Excel Discussion (Misc queries) | |||
Can't assign to Array .GetRows in Excel 97 | Excel Programming | |||
How do I assign values to an array? | Excel Programming | |||
Possible to assign an array to a SeriesCollection | Excel Programming |