Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 212531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:11:43+00:00 2026-05-11T18:11:43+00:00

So, I needed to take some data done in MS Word tables, and manipulate

  • 0

So, I needed to take some data done in MS Word tables, and manipulate in excel.
I decided to get it from word to excel via a VBA subroutine to “save time”.
My source word document contained like twentysomething tables.

I took my source document’s tables, extracted my data and made a new document, with a new table, only needing me to copy and paste it into excel.

However, while the final table before copy looks good in word. When i copy it to excel, it breaks up the cells that contain whole paragraphs into separate cells.

As most excel peeps would know, even though a solution looks like in excel, doing a merge and center – that only preserves the content in the uppermost cell in the selection!

So, any advice, on either a better merge and center, or a better “time saver” alltogether, would be great.

Here’s a sample of the code so far:

Sub First()

Dim tableLength, tableIndex
tableLength = ThisDocument.Tables.Count

Dim tblReport As Table
Dim docReport As Document

Set docReport = Documents.Add
Set tblReport = docReport.Tables.Add(Selection.Range, 1, 2)

With tblReport

Dim fieldOne, subvalueAription, subvalueA, subvalueB, subvalueC

For tableIndex = 1 To tableLength

    fieldOne = ThisDocument.Tables(tableIndex).Rows(2).Cells(2).Range.Text
    subvalueA = Trim(ThisDocument.Tables(tableIndex).Rows(4).Cells(2).Range.Text)
    subvalueB = "A: " & Trim(ThisDocument.Tables(tableIndex).Rows(5).Cells(2).Range.Text)
    subvalueC = "B: " & Trim(ThisDocument.Tables(tableIndex).Rows(6).Cells(2).Range.Text)
    subvalueAription = subvalueA & subvalueB & subvalueC & "C: "

    Dim rowNext As row
    Set rowNext = .Rows.Add
    rowNext.Cells(1).Range.Text = fieldOne
    rowNext.Cells(2).Range.Text = subvalueA & subvalueB & subvalueC


Next

End With


End Sub
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T18:11:43+00:00Added an answer on May 11, 2026 at 6:11 pm

    Excel uses a different line terminator than Word. In order to avoid the problem with the text from the Word table being split over several Excel cells, you need to handle the line terminator conversion yourself.

    'Word > Excel
     newText = Replace(wordText, vbCrLf, vbLf)
    

    I’m posting this by memory, but that’s the root of that problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

** EDIT ** Nevermind, just needed to take out the parens... I get this
Almost all of the applications I write at work get their data from a
Whenver Ajax requests new data from the server this can sometimes take a a
I would like to better understand the basic steps needed to a take an
I needed some simple string encryption, so I wrote the following code (with a
I needed to re-install my computer but I didn't think about exporting the data
I have a program below that tries to take input from the user and
I need to compress/decompress some Data with a old, in house developed Algorithm. There
I'm relatively new to Flex however needed to take over maintenance and development of
I'm building an app to serve large amounts of data via REST API and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.