Uma família de softwares de planilhas da Microsoft com ferramentas para analisar, criar gráficos e comunicar dados.
Execute essa rotina que adaptei do site do Dick Kusleika:
Sub CopyRangeToPlainTextOutlookAlignment()
Dim rCell As Range Dim rCol As Range Dim aMax() As Long Dim lCol As Long Dim lSpaces As Long Dim sOutput As String Dim rRow As Range Dim doClip As MSForms.DataObject Dim sTemp As String
If TypeName(Selection) = "Range" Then Set doClip = New MSForms.DataObject
ReDim aMax(1 To Selection.Columns.Count)
For Each rCol In Selection.Columns
lCol = lCol + 1
For Each rCell In rCol.Cells
If Not rCell.EntireRow.Hidden Then
sTemp = Trim(rCell.Text)
If Len(sTemp) > aMax(lCol) Then aMax(lCol) = Len(sTemp)
End If
Next rCell
Next rCol
For Each rRow In Selection.Rows
If Not rRow.Hidden Then
lCol = 0
For Each rCell In rRow.Cells
lCol = lCol + 1
sTemp = Trim(rCell.Text)
lSpaces = Len(Space(aMax(lCol) - Len(sTemp)))
Select Case rCell.HorizontalAlignment
Case xlHAlignCenter
sOutput = sOutput & Space(lSpaces \ 2 + lSpaces Mod 2) & \_
sTemp & Space(lSpaces \ 2) & Space(2)
Case xlHAlignLeft
sOutput = sOutput & sTemp & Space(lSpaces) & Space(2)
Case xlHAlignRight
sOutput = sOutput & Space(lSpaces) & sTemp & Space(2)
Case Else
If IsNumeric(rCell.Value) Or IsDate(rCell.Value) Then
sOutput = sOutput & Space(lSpaces) & sTemp & Space(2)
Else
sOutput = sOutput & sTemp & Space(lSpaces + 2)
End If
End Select
Next rCell
sOutput = RTrim(sOutput) & vbNewLine
End If
Next rRow
doClip.SetText sOutput
doClip.PutInClipboard
End If
End Sub
Para utilizar essa rotina, basta selecionar um texto e executá-la. A tabela no formato de texto ficará na sua Área de Transferência (ou seja, com umCtrl+V você cola os valores no Word). É interessante que essa rotina inclusive preserva o alinha do texto ou número da tabela. Você pode adicionar ela naBarra de Ferramentas de Acesso Rápido, se quiser.
Observação: Você deve adicionar referência à bibliotecaMicrosoft Forms 2.0 Forms Library.
Link original desse código: http://www.dailydoseofexcel.com/archives/2010/12/14/outlook-plain-text-tables/
Felipe Costa Gualberto - http://www.ambienteoffice.com.br