Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Alan,
Thanks a million! Bob "Alan Beban" wrote: Here's a quick and dirty function to insert a row between "betw1" and "betw2" (the rows between which the new row will go), which relies on functions from the downloaded file. Watch for wordwrap. The function works only for Variant() arrays and arrays contained within Variant variables, and it has no error checking. Function InsertRow(inputArray, newRow, betw1, betw2) As Boolean InsertRow = False ResizeArray inputArray, UBound(inputArray) + 1 sa1 = SubArray(inputArray, LBound(inputArray, 2), UBound(inputArray, 2), 1, betw1) sa2 = SubArray(inputArray, LBound(inputArray, 2), UBound(inputArray, 2), betw2, UBound(inputArray) - 1) inputArray = ArrayReshape(MakeArray(sa1, newRow, sa2, 1), UBound(inputArray), UBound(inputArray, 2)) InsertRow = True End Function Alan Beban Bob wrote: Tom, Thanks for your help! It looks like your code inserts a new "row" between "rows" 14 and 15. Am I reading it right? If so, can you tell me how to modify your code into a UDF whereby I can pass it a "row number" (e.g., rownum)? Thanks again, Bob |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
"Type mismatch" when I try to fill an Array variable with "+" | Excel Discussion (Misc queries) | |||
Listbox header inside VBA (Array("Head1", "Head2", ...) | Excel Programming | |||
inserting a conditional "go to" command on a excel "if" function | Excel Worksheet Functions | |||
If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ... | Excel Programming |