Insert data to Word

panchinxd

New Member
Joined
Apr 26, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hey Guys just found your forum a couple of days ago!

I have been trying to make some reports from excel to word, and I could get it right! let's say I have 5 customers from which I have to make a report, they could n customers! (this is my hardest part)
Which i have to add them on the blank, them move it to word, i would really appreciate your time, thank you so much and have a good day

Juan Carlos

VBA Code:
Option Explicit

Sub CreateReporteWord()
Dim WordApp As Word.Application
Set WordApp = New Word.Application


With WordApp
    .Visible = True
    .Activate
    .Documents.Add
    
    
    ' Inicio del Documento, Nombre de documento
    
    With .Selection
        .BoldRun
        .Font.Underline = wdUnderlineSingle
        .Font.Name = "Courier New"
        .Paragraphs.Alignment = wdAlignParagraphCenter
        .Font.Size = 12
        .TypeText "Customers Report"
        .Font.Underline = False
        .TypeParagraph
        .BoldRun
  
        
        .TypeText " Customer data, views as product. As an example"
        .TypeParagraph
        .Font.Underline = False
        
        ' Insert customers
        
        .BoldRun
        .TypeText "Name: "
        .BoldRun
        
        .Paragraphs.Alignment = wdAlignParagraphJustify
        
        .Font.Underline = wdUnderlineSingle
        .TypeText "_____________________"
        .Font.Underline = False
        
        .BoldRun
        .TypeText "Amount "
        .BoldRun
        
        .Font.Underline = wdUnderlineSingle
        .TypeText "_____________________"
        .Font.Underline = False
        
        .BoldRun
        .TypeText "Years "
        .BoldRun
        
        .Font.Underline = wdUnderlineSingle
        .TypeText "_____________________"
        .Font.Underline = False
        
        .BoldRun
        .TypeText "Int "
        .BoldRun
        
        .Font.Underline = wdUnderlineSingle
        .TypeText "_____________________"
        .Font.Underline = False
        
        
        
    End With
    
End With


End Sub
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Why not use mailmerge?

Hey Macropod, thanks for your advice!

I have to add like 50 of them from 6 different worksheets, and reduce them to 3 pages! I think working on VBA would definitely reduce the time of work!

not sure if you can do this automatically using mailmerge
 
Upvote 0
Well, if you're going to do this using VBA, you should at least start of by using a properly-constructed Word template.

And, since you haven't said what's on the different worksheets - or even what their names are - and how the data on those worksheets are related to each other and are to be represented in Word, it's impossible to know what the best way of approaching the problem.
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,928
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top