Saltar al contenido
PROGRAMAR EN VBA MACROS DE EXCEL

Conectar Excel con Word y dar formato a texto en Word


(adsbygoogle = window.adsbygoogle || []).push({});

Anteriormente se publicaron otros ejemplos que permiten la conexión de Excel con Word o dicho de otro modo como manejar o manipular Word desde Excel; ahora muestro como desde Excel se puede dar formato a texto de Word.

Las macros relacionadas sobre como conectar Word son Excel son las siguientes:

Como crear un archivo de Word con Excel
Como Abrir un archivo de Word con Excel
Como conectar Excel con Word crear archivo e insertar texto en Word
Como dar formato a texto de Word desde Excel 

Recomiendo que leas un excelente libro sobre Excel que te ayudará operar las planillas u hojas de cálculo, haz click acá, si quieres aprender sobre Excel, en inglés, entonces debes hacer click here. Si lo que necesitas es aprender o profundizar sobre la programación de macros con VBA este es unos de los mejores cursos on line que he visto en internet.

  

Desde el link del final podrás descargar el ejemplo, lo cual es necesario para que puedas comprender con facilidad el ejemplo de macro que permite dar formato a texto de Word desde Excel; en en vídeo que se encuentra seguidamente podrás ver una explicación más detallada de lo que permite hacer cada código como también ver su funcionamiento en forma gráfica.

En el fichero de ejemplo, verás un botón que al presionarlo permite, crear un archivo de word, luego insertar el dato que se encuentra en la celda B4, una vez inserto, le dará distintos formatos, en primero lugar dará un tamaño de letra 15, negrita, insertará comillas de apertura y de cierre; por último insertará paréntesis al principio y final del texto. También es posible cambiar el tipo de letra o fuente y asignar el formato que sea necesario a Word, todo desde una macro de Excel.

Suscribe a nuestro canal de You Tube para recibir en tu correo vídeos explicativos sobre macros interesantes, como  por ejemplo formulario que crea un listado de todas las hojas para poder luego seleccionarlas, buscar en listbox mientras escribes en textbox, ordenar hojas libro excel por su nombre, conectar Excel con Access y muchos ejemplos más.

function onYtEvent(payload) {
if (payload.eventType == ‘subscribe’) {
// Add code to handle subscribe event.
} else if (payload.eventType == ‘unsubscribe’) {
// Add code to handle unsubscribe event.
}
if (window.console) { // for debugging only
window.console.log(‘YT event: ‘, payload);
}
}

Código que se inserta en un módulo
Sub ExcelEscribeWord()
Dim objWord As Word.Application, wdDoc As Word.Document, def As String
On Error Resume Next
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set a = Sheets(ActiveSheet.Name)
tex = a.Range(«B4»)
Set objWord = CreateObject(«Word.Application»)
objWord.Visible = True
Set wdDoc = objWord.Documents.Add
uf = a.Range(«B» & Rows.Count).End(xlUp).Row
tex = a.Cells(4, «B»)
objWord.ActiveDocument.Content.FormattedText.Text = tex
objWord.ActiveDocument.Content.Font.Size = 15
objWord.ActiveDocument.Content.Font.Bold = True
objWord.ActiveDocument.Content.InsertBefore «»»»
objWord.ActiveDocument.Content.InsertAfter «»»»
objWord.ActiveDocument.Content.InsertBefore «(«
objWord.ActiveDocument.Content.InsertAfter «)»
objWord.ActiveDocument.Content.InsertParagraphAfter
objWord.ActiveDocument.Select

MsgBox («El libro se generó con éxito»), vbInformation, «AVISO»
objWord.Activate
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub

Si te fue de utilidad puedes INVITARME UN CAFÉ y de esta manera ayudar a seguir manteniendo la página, CLICK para descargar en ejemplo en forma gratuita.


(adsbygoogle = window.adsbygoogle || []).push({});

If this post was helpful INVITE ME A COFFEE and so help keep up the page, CLICK to download free example.

Si te gustó por favor compártelo con tus amigos
If you liked please share it with your friends      

Entradas relacionadas

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Comentarios (43)

I’m the business owner of JustCBD Store label (justcbdstore.com) and I am currently planning to expand my wholesale side of business. It would be great if someone at targetdomain is able to provide some guidance 🙂 I thought that the most ideal way to do this would be to connect to vape stores and cbd stores. I was hoping if anyone could recommend a trustworthy site where I can buy CBD Shops B2B Database I am already reviewing creativebeartech.com, theeliquidboutique.co.uk and wowitloveithaveit.com. Not sure which one would be the very best solution and would appreciate any advice on this. Or would it be simpler for me to scrape my own leads? Ideas?

Responder

Very nice write-up. I definitely love this site. Stick with it!

Responder

Great information. Lucky me I came across your site by accident (stumbleupon). I have book-marked it for later!

Responder

Excellent web site you’ve got here.. It’s hard to find good quality writing like yours nowadays. I seriously appreciate individuals like you! Take care!!

Responder

I’m very happy to discover this website. I want to to thank you for your time for this particularly fantastic read!! I definitely savored every bit of it and i also have you bookmarked to look at new things in your site.

Responder

Excellent article. I certainly love this site. Keep it up!

Responder

Your style is really unique in comparison to other people I have read stuff from. Many thanks for posting when you have the opportunity, Guess I’ll just book mark this web site.

Responder

naturally like your website but you have to test the spelling on quite a
few of your posts. A number of them are rife with spelling issues and I to find it very troublesome
to inform the truth nevertheless I will certainly come again again.

Responder

I simply want to mention I am just beginner to blogging and site-building and truly enjoyed you’re website. More than likely I’m likely to bookmark your website . You definitely come with good well written articles. Bless you for sharing your web page.

Responder

Thanks for finally writing about > Conectar Excel con Word y
dar formato a texto en Word – PROGRAMAR EN VBA MACROS DE EXCEL < Loved it!

Responder

Hello, Neat post. There’s an issue together with your website in web explorer, may check this?
IE nonetheless is the market leader and a huge part of other folks will miss your fantastic writing due to this problem.

Responder

We’re a group of volunteers and starting a new scheme in our community.
Your web site offered us with helpful information to work on. You’ve
performed a formidable job and our entire community might be thankful
to you. 3aN8IMa cheap flights

Responder

Thanks for any other informative site. The place else may I get that kind
of information written in such a perfect means?
I’ve a challenge that I’m simply now working on, and I have been on the glance out for
such information. cheap flights 2CSYEon

Responder

Awesome article.

Responder

Hi, i think that i noticed you visited my site so i came to
return the choose?.I’m attempting to in finding things to enhance my site!I
assume its adequate to use a few of your concepts!!

Responder

I’m not sure why but this website is loading very slow for me.

Is anyone else having this problem or is it a issue on my end?
I’ll check back later on and see if the problem still
exists.

Responder

Great post! We will be linking to this great content on our website. Keep up the good writing.

Responder

A motivating discussion is worth comment. I do think that you should publish more about this subject, it might not be a taboo subject but typically folks don’t discuss these issues. To the next! Best wishes!!

Responder

bookmarked!!, I really like your web site!

Responder

This is a good tip especially to those new to the blogosphere. Simple but very precise info… Appreciate your sharing this one. A must read article!

Responder

You should be a part of a contest for one of the best websites online. I most certainly will recommend this website!

Responder

I’m impressed, I have to admit. Rarely do I come across a blog that’s both educative and engaging, and let me tell you, you’ve hit the nail on the head. The issue is something which not enough people are speaking intelligently about. I’m very happy that I found this during my search for something regarding this.

Responder

May I simply just say what a relief to discover someone who really understands what they are talking about on the net. You actually know how to bring a problem to light and make it important. More people should read this and understand this side of your story. I can’t believe you’re not more popular since you surely possess the gift.

Responder

Hello there! I simply wish to give you a huge thumbs up for your excellent info you’ve got right here on this post. I am coming back to your blog for more soon.

Responder

You’ve made some really good points there. I checked on the web for more information about the issue and found most people will go along with your views on this website.

Responder

I enjoy reading through a post that will make men and women think. Also, thanks for permitting me to comment!

Responder

An interesting discussion is definitely worth comment. I think that you ought to write more about this subject, it might not be a taboo matter but typically people don’t speak about such subjects. To the next! All the best!!

Responder

I would like to thank you for the efforts you have put in writing this blog. I really hope to see the same high-grade blog posts by you later on as well. In fact, your creative writing abilities has encouraged me to get my own, personal blog now 😉

Responder

Whether you’re preparation an amazing vacation or taking a spur in the moment jaunt, occasionally, it’s the tiny particulars which can be the determining component how significantly you love your time and effort out and about. The data in this article will help you plan the right getaway. Abandon all unnecessary valuable items at home. You are taking the health risks of experiencing almost everything taken of your stuff should you bring possessions with you. In case you are visiting a region which has a water-restriction on all liquids you could be loading, put money into nightclub hair shampoos and teeth powder. Amazingly, you can actually discover club shampoo and tooth paste obtainable in natural powder type online. These materials are a great way to have around liquid-restrictions. When traveling in places with hazardous plain tap water, recall alternative methods that you might be revealed. Near your mouth when using the shower room and brush your tooth only with handled h2o. If you make herbal tea or caffeine together with the water, give it time to boil for a lot of a few minutes before steeping. Even a tiny visibility will make you extremely sickly. Get a travel dress, which is actually a outfit that may be worn numerous techniques. It can be worn being a outfit, skirt, shirt and wrap. Then you can package a couple of other accessories and related items, which can preserve lots of space within your suitcase for those mementos you want to provide residence. Consider a couple of clothespins with you if you journey. It is an uncommon piece to take into account packing, nevertheless they can be quite valuable. If you’re going on a luxury cruise, ensure you provide a small day travelling bag along with you. You’ll learn that your suitcases won’t be available right away once you board the dispatch. So you’ll need to have a bag by using a go swimming match, a novel, an extra modify of clothes within it, and other things you might need right away. Wherever you wish to go, organizing is likely to make your holiday all it may be. Make use of the guidance you’ve read in this article to get the most out of your travelling expertise.

Responder

Nice to meet you chaudiere gaz condensation megalis elm leblanc The rains have eased in Colorado and a fleet of Chinook helicopters have resumed the rescue operation fanning out across the state where eight people have lost their lives after a week of torrential rain.

Responder

We absolutely love your blog and find almost all of your post’s to be just what I’m looking for. can you offer guest writers to write content available for you? I wouldn’t mind creating a post or elaborating on a number of the subjects you write in relation to here. Again, awesome web site!

Responder

wonderful issues altogether, you simply received a logo reader. What could you suggest in regards to your post that you made some days ago? Any certain?

Responder

I will immediately grab your rss as I can not find your email subscription link or e-newsletter service. Do you’ve any? Please let me know in order that I could subscribe. Thanks.

Responder

This is very interesting, You’re a very skilled blogger. I have joined your feed and look forward to seeking more of your excellent post. Also, I have shared your site in my social networks!

Responder

I’m truly enjoying the design and layout of your blog. It’s a very easy on the eyes which makes it much more enjoyable for me to come here and visit more often. Did you hire out a designer to create your theme? Outstanding work!

Responder

The date is placed on diary and calendar

Responder

This was simply awesome and your post is cool.

Responder

It’s laborious to search out educated individuals on this matter, however you sound like you know what you’re talking about! Thanks

Responder

Great – I should definitely pronounce, impressed with your web site. I had no trouble navigating through all the tabs as well as related information ended up being truly easy to do to access. I recently found what I hoped for before you know it in the least. Quite unusual. Is likely to appreciate it for those who add forums or something, website theme . a tones way for your client to communicate. Nice task..

Responder

Today, I went to the beach with my children. I found a sea shell and gave it to my 4 year old daughter and said «You can hear the ocean if you put this to your ear.» She put the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is completely off topic but I had to tell someone!

Responder

very nice post, i certainly enjoy this site, persist in it

Responder

Hello! This post couldn’t be written any better! Reading through this post reminds me of my old room mate! He always kept talking about this. I will forward this page to him. Fairly certain he will have a good read. Thanks for sharing!

Responder

Hi, i believe that i noticed you visited my web site thus i came to “return the desire”.I am attempting to to find things to improve my site!I assume its adequate to use some of your ideas!!

Responder