Saltar al contenido
PROGRAMAR EN VBA MACROS DE EXCEL

Macro insertar celdas

Como insertar celdas mediante macro, mostrar como se agregan celdas mediante macro, es el objeto de este post, en el anterior se mostró como se insertan columnas mediante macro, son códigos parecidos, no obstante tienen diferencias, se usa el mismo ejemplo adaptado, desde el link que se encuentra al final del post podrás descargar el ejemplo para que veas su funcionamiento y codificació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.

  

Siguiendo con el tema del post, se describen y analizas las macros para insertar celdas que se muestran a continuación; el primero de los tres códigos presentados permite seleccionar el rango B3 a C5 y luego inserta una celda desplazando las celdas hacia abajo.

El segundo código selecciona el rango B3 a C5 y posteriormente inserta, como en el caso anterior dos celdas y desplaza el contenido hacia la derecha, se debe notar que se insertan una cantidad de celdas idénticas a la seleccionada, si se desea insertar solamente una fila, se debe seleccionar una sola celdas.

El tercer ejemplo, permite insertar celdas cortadas, usando el comando «cut», también se puede insertar celdas copiadas con el comando «copy»; el código mostrado selecciona un rango en este caso B3 a C5 y lo corta; luego selecciona el rango donde se quiere pegar los datos cortados, una vez seleccionada la celda, pega los datos desplazando las celdas hacia la derecha.

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 debe ingresar en un módulo

Sub Inserceldad()
Range(«B3:C5»).Select
Selection.Insert Shift:=xlDown
End Sub

Sub Inserceldal()
Range(«B3:C5»).Select
Selection.Insert Shift:=xlToRight
End Sub

Sub Insertcel()
Range(«B3:C5»).Cut
Columns(«G:G»).Select
Selection.Insert Shift:=xlToRight
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 (32)

I am the proprietor of JustCBD brand (justcbdstore.com) and am trying to expand my wholesale side of business. It would be great if anybody at targetdomain share some guidance 🙂 I considered that the most suitable way to accomplish this would be to connect to vape stores and cbd stores. I was really hoping if someone could suggest a trusted site where I can get Vape Shop B2B Database with Email Addresses I am currently examining creativebeartech.com, theeliquidboutique.co.uk and wowitloveithaveit.com. On the fence which one would be the very best selection and would appreciate any advice on this. Or would it be much simpler for me to scrape my own leads? Ideas?

Responder

Проведем официальную процедуру и услуга банкротство юридических лиц вопрос интереснен каждому бенефициару

Responder

Hello there! This blog post couldn’t be written much better! Going through this post reminds me of my previous roommate! He continually kept preaching about this. I am going to forward this article to him. Pretty sure he’ll have a very good read. Many thanks for sharing!

Responder

I’d like to thank you for the efforts you’ve put in penning this website. I am hoping to check out the same high-grade blog posts from you later on as well. In truth, your creative writing abilities has inspired me to get my own site now 😉

Responder

This is a topic that is near to my heart… Many thanks! Exactly where are your contact details though?

Responder

Aw, this was an incredibly nice post. Spending some time and actual effort to create a very good article… but what can I say… I put things off a whole lot and don’t manage to get anything done.

Responder

Right here is the perfect site for anyone who wants to find out about this topic. You know so much its almost tough to argue with you (not that I actually will need to…HaHa). You definitely put a new spin on a topic which has been discussed for years. Great stuff, just great!

Responder

Greetings! Very useful advice within this article! It is the little changes that will make the largest changes. Many thanks for sharing!

Responder

Good post. I’m dealing with many of these issues as well..

Responder

Aw, this was an extremely good post. Spending some time and actual effort to generate a really good article… but what can I say… I hesitate a lot and don’t manage to get anything done.

Responder

Right here is the right blog for everyone who hopes to find out about this topic. You understand a whole lot its almost tough to argue with you (not that I personally would want to…HaHa). You definitely put a new spin on a topic that’s been written about for many years. Excellent stuff, just wonderful!

Responder

After looking at a few of the articles on your website, I really appreciate your way of blogging. I bookmarked it to my bookmark website list and will be checking back in the near future. Take a look at my website as well and tell me your opinion.

Responder

I blog frequently and I seriously thank you for your information. The article has really peaked my interest. I will book mark your site and keep checking for new details about once per week. I opted in for your RSS feed as well.

Responder

This is the perfect web site for anyone who hopes to understand this topic. You understand so much its almost hard to argue with you (not that I personally will need to…HaHa). You definitely put a fresh spin on a subject which has been written about for decades. Wonderful stuff, just great!

Responder

Excellent post. I’m dealing with a few of these issues as well..

Responder

Having read this I believed it was extremely informative. I appreciate you taking the time and effort to put this informative article together. I once again find myself personally spending a lot of time both reading and leaving comments. But so what, it was still worth it!

Responder

After I initially left a comment I seem to have clicked the -Notify me when new comments are added- checkbox and now whenever a comment is added I get four emails with the exact same comment. Is there an easy method you are able to remove me from that service? Kudos!

Responder

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

Responder

This is a really good tip especially to those new to the blogosphere. Brief but very accurate info… Many thanks for sharing this one. A must read article!

Responder

You need to be a part of a contest for one of the highest quality sites on the internet. I’m going to recommend this website!

Responder

Spot on with this write-up, I truly believe this amazing site needs far more attention. I’ll probably be back again to read more, thanks for the advice!

Responder

There’s definately a great deal to learn about this subject. I love all the points you made.

Responder

Greetings! Beneficial advice in this article! It’s the little changes that makes the greatest changes.
Thanks for sharing!

Visit my web page – RossPDolly

Responder

There’s certainly a lot to know about this subject. I love all the points you’ve made.

Responder

Can I simply just say what a relief to find an individual who really knows what they’re discussing on the internet. You definitely know how to bring an issue to light and make it important. A lot more people ought to look at this and understand this side of your story. I was surprised that you’re not more popular given that you most certainly possess the gift.

Responder

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

Responder

Hi there, I believe your website could be having browser compatibility problems. Whenever I take a look at your web site in Safari, it looks fine but when opening in Internet Explorer, it’s got some overlapping issues. I just wanted to give you a quick heads up! Apart from that, excellent website!

Responder

Hello there, I do believe your site could possibly be having web browser compatibility problems. When I take a look at your website in Safari, it looks fine however, when opening in Internet Explorer, it’s got some overlapping issues. I merely wanted to provide you with a quick heads up! Other than that, excellent website!

Responder

I couldn’t refrain from commenting. Very well written!

Responder

You are so cool! I do not believe I’ve truly read through anything like this before. So good to find somebody with a few genuine thoughts on this issue. Really.. thanks for starting this up. This web site is something that’s needed on the web, someone with a little originality!

Responder

I couldn’t refrain from commenting. Well written!

Responder

Excellent article. I’m going through a few of these issues as well..

Responder