LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 391
Default Issue with array

2003/2007

My goal is to ID both the Position [OprPosition(iCounter)] and the actual Operator sign
[OprSign(Icounter)] in that position.

My Formula string is:
='3 Period Average EBITDA Summary'!H8+ _
'3 Period Average EBITDA Summary'!H22+ _
'3 Period Average EBITDA Summary'!H23

The string position of the first "+" in the formula is 38.

Ideally, I would like the array elements to be:
OprPosition(38) to equal 38 and
OprSign(38) to equal "+"
(to me meaning - in the immediate window ? OprPosition(38) yields 38
(and ? OprSign yields "+")

My logic is that that iCounter AND OprSign AND OprPosition are the same.
Is there a better way to do this??

Sub Test()

Dim p As Long
Dim s As Long
Dim iCounter As Long
'
Dim OprSign() As String
ReDim OprSign(1 To Len(ActiveCell.Formula)) As String
ReDim OprPosition(1 To Len(ActiveCell.Formula)) As Long
OprSigns = Array("+", "-", "*", "/", "^", "", "<", "<", "=", "<=")

For iCounter = 1 To Len(ActiveCell.Formula) Step 1
For s = 0 To 9
'p = InStr(iCounter, Mid(ActiveCell.Formula, iCounter, 1), OprSigns(s), vbTextCompare)
If Mid(ActiveCell.Formula, iCounter, 1) = OprSigns(s) Then
OprPosition(iCounter) = iCounter ' this works fine
OpSign(iCounter) = OprSigns(s) ' this does not work
'OpSign = OprSigns(s)
' = OprSigns(s)
End If
'OprPosition(pCounter) = OperSigns
Next s
Next iCounter
End With

End Sub


TIA EagleOne
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
combining cells and array from different sheets into an array to pass to IRR() [email protected] Excel Discussion (Misc queries) 3 September 11th 06 07:17 AM
Array constant issue Sige Excel Worksheet Functions 16 March 16th 06 02:56 PM
Help with complex index array issue kkendall Excel Worksheet Functions 4 August 5th 05 10:15 PM
Goal Seek On Members of an Array within Array LostInVBA Excel Worksheet Functions 1 June 27th 05 11:01 PM


All times are GMT +1. The time now is 02:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"