Excel VBA Concatenate only visible cells of filtered column. Test code included -
good day all,
i'm trying concatenate filtered column single cell separated commas. know little coding, code provided others after hours of searching.
so far, function works concatenates invisible, filtered out cells:
function test1(myrange range) dim aoutput each entry in myrange if not isempty(entry.value) aoutput = aoutput & entry.value & ", " end if next test1 = left(aoutput, len(aoutput) - 1) end function
and 1 works remove duplicates range, has same problem:
function test2(byref rrng range, optional byval sdelim string = ", ") string dim odict object dim rcell range dim stxt string set odict = createobject("scripting.dictionary") odict each rcell in rrng if .exists(rcell.text) 'do nothing else .add rcell.text, rcell.text stxt = stxt & sdelim & rcell.text end if next rcell end test2 = mid(stxt, len(sdelim) + 1) end function
is possible alter 2 functions ignore invisible, filtered out cells in column?
thanks reading,
brian
consider:
public function test1(myrange range) dim aoutput string, entry range each entry in myrange if entry.entirerow.hidden = false aoutput = aoutput & entry.value & ", " end if next test1 = left(aoutput, len(aoutput) - 1) end function
Comments
Post a Comment