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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -