Help w/Merge Cells Macro


can me short macro please?  i've got table can have different amounts of columns (5 10) , lots of rows of course.  i'd click left cell in given row then run a macro will:

  1. select cells right
  2. merge cells
  3. enter text, "notes:" cell along
  4. enter one: carriage return

that's it.  please?  (i can't write vba crap!) 
in advance!!! 
~dax

 




try this:

  sub mergecells()    dim doc as word.document    dim rng as word.range        set doc = word.activedocument    set rng = word.selection.range        if rng.information(wdwithintable) then      rng.startof unit:=word.wdrow      rng.endof unit:=word.wdrow, extend:=word.wdextend      rng.cells.merge      rng.text = "notes:" & vbcr    end if    end sub  

 


kind regards, rich ... http://greatcirclelearning.com


Microsoft Office  >  Word IT Pro Discussions



Comments

Popular posts from this blog

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)

Failed to delete the test record dcdiag-test-record in zone test.com

Azure MFA with Azure AD and RDS