LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Iteration

A repost that might clarify what's going on:

Is there a standard way of handling something like
the following?

Function DeleteColumn(inputArray, ColumnNumber)
If IsArray(ColumnNumber) Then
[Run the DeleteColumn function itself]
[on each column number in turn]
inputArray = arrOut
DeleteColumn = arrOut
Exit Function
Else
[code to create an array of the input]
[array less the single column number,]
[assigned to the variable arrOut]
inputArray = arrOut
DeleteColumn = arrOut
End If
End Function

I ended up creating a DeleteColumnAdjunct function
that is the same as the DeleteColumn function
except for name, and ran

Function DeleteColumn(inputArray, ColumnNumber)
If IsArray(ColumnNumber) Then
For w = UBound(ColumnNumber) To _
LBound(ColumnNumber) Step -1
arrOut = DeleteColumnAdjunct(inputArray, ColumnNumber(w))
Next
inputArray = arrOut
DeleteColumn = arrOut
Exit Function
Else
[code to create an array of the input]
[array less the single column number,]
[assigned to the variable arrOut]
inputArray = arrOut
DeleteColumn = arrOut
End If
End Function

It works, but I can't help thinking I'm missing the forest for the trees.

Thanks,
Alan Beban
 
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
Iteration Khalil[_2_] Excel Worksheet Functions 4 June 19th 09 08:21 PM
iteration Gareth Milton Excel Discussion (Misc queries) 1 March 28th 07 04:18 PM
Need help with iteration Ron M. Excel Discussion (Misc queries) 7 March 14th 06 12:32 AM
Iteration M. Homayon Excel Discussion (Misc queries) 1 January 11th 06 01:05 AM
Iteration Jan Excel Discussion (Misc queries) 1 January 10th 06 11:10 PM


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

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

About Us

"It's about Microsoft Excel"