Saltar al contenido
PROGRAMAR EN VBA MACROS DE EXCEL

Formulario inserta hyperlink en celda


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

En un foro me preguntan sobre como se puede desde un userform o formulario pasar a una celda un hiperlink o hipervínculo y que al hacer click ejecute el programa predeterminado para mandar un correo electrónico o mail, el tema de como insertar un hyperlink en Excel ha sido tratado en varias oportunidades en esta web, no obstante ello y a pesar de ser similar, agregó este ejemplo que permite insertar un hipervínculo o hyperlink desde un textbox a una celda de excel.

Desde el link del final podrás  bajar el archivo de ejemplo y adaptarlo a tus necesidades, el código es libre y no tiene ningún tipo de restricción.

Antes de seguir recomiendo leer 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.

  

Al descargar el ejemplo de macro o código de VBA, verás que existe un botón insertado que permite llamar un formulario, este formulario es muy simple, solo tiene un Textbox que inserta el contenido en una celda de Excel, la particularidad es que el dato que se ingrese se convertirá en un hyperlink o hipervínculo de correo electrónico, es decir abrirá el programa predeterminado para el envío de mails, que por lo general es Outlook.

El formulario tiene dos botones uno para cancelar y cerrar el formulario y el otro que permite guardar en la celda el dato introducido en el textbox, la macro sola determina la última fila con datos o primer fila libre para pegar el dato del textbox; el ejemplo lo puedes descargar sin restricción desde el link del final de este post, el código que se incorpora a continuación es el que encontrarás en el ejemplo, si lo observas tiene una codificación que se deber insertar en un módulo, esto es a los fines de llamar el formulario, el resto de la codificación que se inserta en un userform es el que permite crear el hyperlink o hipervínculo.

El vídeo que sigue muestra una explicación más detallada y gráfica de la macro presentada, recomiendo observar para una más fácil comprensión de la macro; suscribe a nuestra web desde la parte superior derecha de la página ingresando tu mail y 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 seleccionarlasbuscar en listbox mientras escribes en textboxordenar hojas libro excel por su nombreconectar 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 ir()
UserForm1.Show
End Sub

Código que se inserta en userform

Private Sub CommandButton1_Click()
Dim uf As Integer
Dim m, dt As String
uf = Sheets(«hoja1»).Range(«A» & Rows.Count).End(xlUp).Row
m = «mailto:» & TextBox1
dt = TextBox1
Sheets(«hoja1»).Hyperlinks.Add Anchor:=Sheets(«hoja1»).Cells(uf + 1, 1), Address:=m, TextToDisplay:=dt
‘Sheets(«hoja1»).Hyperlinks.Add Anchor:=Sheets(«hoja1″).Cells(uf + 1, 1), Address:=»mailto:someone@example.com?subject=hello»
End Sub
Private Sub CommandButton2_Click()
Unload Me
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 un comentario

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

Comentarios (29)

I am the owner of JustCBD Store company (justcbdstore.com) and I am currently seeking to grow my wholesale side of business. I am hoping someone at targetdomain is able to provide some guidance . I thought that the most suitable way to do this would be to connect to vape shops and cbd retail stores. I was hoping if anybody could suggest a qualified website where I can purchase Vape Shop B2B Database I am presently reviewing creativebeartech.com, theeliquidboutique.co.uk and wowitloveithaveit.com. Not exactly sure which one would be the very best option and would appreciate any advice on this. Or would it be simpler for me to scrape my own leads? Suggestions?

Responder

ликвидация ООО для директора фирмы очень важная процедура

Responder

You should take part in a contest for one of the highest quality sites on the internet. I most certainly will highly recommend this web site!

Responder

I like it whenever people get together and share views. Great blog, continue the good work!

Responder

You ought to be a part of a contest for one of the best sites online. I am going to recommend this web site!

Responder

Everything is very open with a very clear clarification of the issues. It was truly informative. Your site is very useful. Thanks for sharing!

Responder

I used to be able to find good advice from your blog articles.

Responder

Having read this I thought it was extremely informative. I appreciate you spending some time and effort to put this informative article together. I once again find myself spending a significant amount of time both reading and commenting. But so what, it was still worthwhile!

Responder

An impressive share! I have just forwarded this onto a coworker who was conducting a little homework on this. And he in fact bought me dinner simply because I stumbled upon it for him… lol. So let me reword this…. Thanks for the meal!! But yeah, thanx for spending the time to discuss this topic here on your internet site.

Responder

Way cool! Some very valid points! I appreciate you penning this write-up plus the rest of the website is also really good.

Responder

Great information. Lucky me I found your site by chance (stumbleupon). I’ve book marked it for later!

Responder

I blog frequently and I genuinely appreciate your information. The article has really peaked my interest. I’m going to take a note of your blog and keep checking for new information about once per week. I opted in for your RSS feed too.

Responder

Oh my goodness! Incredible article dude! Thanks, However I am encountering troubles with your RSS. I don’t understand the reason why I can’t subscribe to it. Is there anybody getting identical RSS problems? Anyone who knows the answer can you kindly respond? Thanx!!

Responder

I was able to find good info from your content.

Responder

Greetings! Very helpful advice in this particular post! It’s the little changes that produce the most important changes. Thanks a lot for sharing!

Responder

The very next time I read a blog, Hopefully it won’t disappoint me just as much as this particular one. I mean, Yes, it was my choice to read through, however I really believed you’d have something useful to say. All I hear is a bunch of moaning about something you can fix if you weren’t too busy searching for attention.

Responder

This is a topic that is near to my heart… Best wishes! Where are your contact details though?

Responder

When I originally commented I seem to have clicked the -Notify me when new comments are added- checkbox and from now on every time a comment is added I receive four emails with the exact same comment. Perhaps there is a means you can remove me from that service? Appreciate it!

Responder

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

Responder

I was able to find good info from your articles.

Responder

May I just say what a relief to find somebody that really knows what they’re talking about online. You definitely realize how to bring an issue to light and make it important. More and more people must look at this and understand this side of the story. It’s surprising you aren’t more popular given that you most certainly have the gift.

Responder

The next time I read a blog, Hopefully it won’t disappoint me as much as this one. I mean, Yes, it was my choice to read, nonetheless I truly believed you would have something useful to say. All I hear is a bunch of moaning about something you could fix if you were not too busy searching for attention.

Responder

After exploring a handful of the blog posts on your website, I seriously like your technique of blogging. I saved as a favorite it to my bookmark site list and will be checking back soon. Take a look at my web site too and let me know how you feel.

Responder

This is the perfect blog for anybody who wants to understand this topic. You know so much its almost hard to argue with you (not that I really will need to…HaHa). You certainly put a new spin on a topic that’s been written about for years. Wonderful stuff, just excellent!

Responder

I’m impressed, I must say. Rarely do I come across a blog that’s both educative and interesting, and without a doubt, you’ve hit the nail on the head. The problem is something which not enough people are speaking intelligently about. Now i’m very happy I stumbled across this in my hunt for something regarding this.

Responder

My relatives all the time say that I am killing my time here at web, but I know I am getting knowledge everyday by reading thes nice articles or reviews.

Responder

Yesterday, while I was at work, my sister stole my iphone and tested to see if it can survive a 40 foot drop,
just so she can be a youtube sensation. My apple ipad is
now destroyed and she has 83 views. I know this is completely off topic but
I had to share it with someone! adreamoftrains web hosting
sites

Responder

Great site you’ve got here.. It’s difficult to find high quality writing like yours these days. I honestly appreciate individuals like you! Take care!!

Responder

Wonderful, what a webpage it is! This weblog gives helpful data to us,
keep it up.

Responder