ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   removing blank entries from an array (https://www.excelbanter.com/excel-programming/348476-removing-blank-entries-array.html)

TheIrishThug[_5_]

removing blank entries from an array
 

i have an array of strings. i'm trying to make a function that will
return the arry without blank entries.

input would be: "text"/"words"/""/"more words"/""
result woud be: "text"/"words"/"more words"


--
TheIrishThug
------------------------------------------------------------------------
TheIrishThug's Profile: http://www.excelforum.com/member.php...o&userid=29682
View this thread: http://www.excelforum.com/showthread...hreadid=494693


Tom Ogilvy

removing blank entries from an array
 
j = lbound(ar) - 1
for i = lbound(ar) to ubound(ar)
if ar(i) < "" then
j = j + 1
ar(j) = ar(i)
end if
Next
Redim Preserve ar(lbound(ar) to j)

--
Regards,
Tom Ogilvy


"TheIrishThug"
wrote in message
news:TheIrishThug.20b0wb_1135024501.6801@excelforu m-nospam.com...

i have an array of strings. i'm trying to make a function that will
return the arry without blank entries.

input would be: "text"/"words"/""/"more words"/""
result woud be: "text"/"words"/"more words"


--
TheIrishThug
------------------------------------------------------------------------
TheIrishThug's Profile:

http://www.excelforum.com/member.php...o&userid=29682
View this thread: http://www.excelforum.com/showthread...hreadid=494693




TheIrishThug[_6_]

removing blank entries from an array
 

thanks Tom

Tom Ogilvy Wrote:
j = lbound(ar) - 1
for i = lbound(ar) to ubound(ar)
if ar(i) < "" then
j = j + 1
ar(j) = ar(i)
end if
Next
Redim Preserve ar(lbound(ar) to j)

--
Regards,
Tom Ogilvy


"TheIrishThug"

wrote in message
news:TheIrishThug.20b0wb_1135024501.6801@excelforu m-nospam.com...

i have an array of strings. i'm trying to make a function that will
return the arry without blank entries.

input would be: "text"/"words"/""/"more words"/""
result woud be: "text"/"words"/"more words"


--
TheIrishThug

------------------------------------------------------------------------
TheIrishThug's Profile:

http://www.excelforum.com/member.php...o&userid=29682
View this thread:

http://www.excelforum.com/showthread...hreadid=494693



--
TheIrishThug
------------------------------------------------------------------------
TheIrishThug's Profile: http://www.excelforum.com/member.php...o&userid=29682
View this thread: http://www.excelforum.com/showthread...hreadid=494693



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com