View Single Post
 
Old 04-04-2014, 11:36 AM
epid011 epid011 is offline Windows 7 64bit Office 2010 32bit
Novice
 
Join Date: Dec 2013
Posts: 12
epid011 is on a distinguished road
Default How to extract text from a cell and preserve special formatting?

The goal of the VBA macro is to extract the text from the first cell and assign it to a variable (see attached document). The problem that I’m having is that I can’t get it to retain the superscripted letter ‘s’ after the word ‘test’.
TIA,
Robert Matthews

Code:
 
 Sub test()
     Dim varTextString As Variant
     varTextString = ActiveDocument.Tables(1).Cell(Row:=1, Column:=1)
     varTextString = Left(varTextString, Len(varTextString) - 2)
     MsgBox   varTextString
 End sub()

Attached Files
File Type: docx Table test with superscripts.docx (13.6 KB, 13 views)
Reply With Quote