excel - vba splitting cells and finding underlines arrays -


below code runs , pulls out words come before "how" no matter how many times appears in cell. need no pulling out words underlined , in italics. know using same method of array splitting can work i'm not sure how can implement find underlined , italicized words. in example below want "pullout" , "you" moved second sheet well. appreciated.

enter image description here

enter image description here

sub te()      dim c range, v string, arr, x long, e      dim d range      dim ws worksheet            set d = worksheets("sheet2").range("b4")             each c in activesheet.range("c1:c105")          v = trim(c.value)          if len(v) > 0                v = replace(v, vblf, " ")                            while instr(v, "  ") > 0                  v = replace(v, "  ", " ")              loop                arr = split(v, " ")              x = lbound(arr) ubound(arr)                  e = arr(x)                                    if not iserror(application.match(lcase(e), array("how"), 0))                      if x > lbound(arr)                          d.value = arr(x - 1) & " " & e                      else                          d.value = "??? " & e                      end if                      set d = d.offset(1, 0)                  end if              next x          end if     next c  end sub    ​


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -