Hi,
I have this function which is used when generating a word document from my excel data. The problem is that in the worrd document, if there is a value, the alignment is right (which is what i want). But if there is no value, the alignment becomes left. How do I change it to right? Thank you very much. The function is below
Function copyExcelTableToWord(inputRange As Range, outputRange As Word.Range) As Word.Range
inputRange.Copy
outputRange.Collapse (wdCollapseEnd) ' Try try: it works! great
outputRange.PasteSpecial Link:=False, Placement:=wdInLine, DisplayAsIcon:=False
Set copyExcelTableToWord = outputRange
End Function
I have this function which is used when generating a word document from my excel data. The problem is that in the worrd document, if there is a value, the alignment is right (which is what i want). But if there is no value, the alignment becomes left. How do I change it to right? Thank you very much. The function is below
Function copyExcelTableToWord(inputRange As Range, outputRange As Word.Range) As Word.Range
inputRange.Copy
outputRange.Collapse (wdCollapseEnd) ' Try try: it works! great

outputRange.PasteSpecial Link:=False, Placement:=wdInLine, DisplayAsIcon:=False
Set copyExcelTableToWord = outputRange
End Function