Saltar al contenido
PROGRAMAR EN VBA MACROS DE EXCEL

Como Eliminar Filas EN BLANCO Excel 2020 #474

Eliminar Filas Vacias en Excel

En este post se muestra Como Eliminar Filas Vacías en Excel con Criterio, es decir que en este caso el criterio para suprimir filas en Excel es que la fila  de Excel se encuentre sin datos o vacías.

Si estás interesado en aprender más sobre como eliminar filas en Excel con Macro te invito a ver el siguiente playlist con varias macros que tratan el tema de Quitar Filas en Blanco en Excel.

Quieres operar Excel en forma eficiente haz lick 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, te lo recomiendo no te arrepentirás.

Mira la Macro en acción Suscribe a nuestro canal para que YouTube te avise cuando se suba nuevo contenido al canal, en el vídeo encontrarás una explicación gráfica y detallada del ejemplo que se muestra en este post.

En que consiste el ejemplo Como Eliminar Filas en Blanco en Excel

Desde el Link del final se puede descargar el Libro Excel utilizado como ejemplo en este post, en forma gratis, una vez que se abre el Libro de Excel, se podrá observar dos botones, uno que dice «Eliminar Fila» que es el que ejecuta la macro de este ejemplo y otro Botón que dice «Ejecutar Nuevamente», este botón sirve únicamente para copiar la base de datos originar que está en la Hoja2, en la Hoja1, y así poder ejecutar la macro una y otra vez hasta entender su funcionamiento si es que se requiere.

La macro realiza un bucle entre la primer y última fila con datos, determinando si la celda  de una columna analizada y la fila que recorre el bucle en ese momento, se encuentre vacía, en ese caso elimina la fila Excel completa y está en blanco, realiza el mismo procedimiento con todas la filas del rango establecido entre la primer y última fila con datos.

⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛⇛

Quizá sea de utilidad también

Como Eliminar Datos Duplicados en Excel

Como Eliminar Filas que coincidan con una Palabra

Código VBA para Quitar o Suprimir Filas Vacías en Excel

La macro crea un objeto con la Hoja1 que es donde está la base de datos para eliminar las filas vacías.

Set a = Sheets(«Hoja1»)

Posteriormente establece cual es la última celda con datos para armar el rango entre la primer y última celda del rango de datos, que es donde está la base de datos a analizar.

uf = Range(«A» & Rows.Count).End(xlUp).Row

Luego se realiza un bucle que va desde la última fila hasta la primer fila con datos, esto se hace a los fines practicos, es decir se está recorriendo y eliminando las filas Excel que coincidan con el criterio para eliminar desde abajo hacia arriba. 

For x = uf To 2 Step -1

Por último se evalúa el dato que contiene la celda que recorre el bucle en cada momento, verificando si es una celda vacía, en ese caso elimina toda la fila en blanco en Excel, para ello se usa el siguiente código.

If a.Cells(x, «A») = Empty Then a.Cells(x, «A»).EntireRow.Delete: conta = conta + 1

A continuación se encuentra el código VBA de la Macro que permite Eliminar Filas en Excel, seguidamente y antes de finalizar el post se encuentre el Link para descargar el archivo Excel de Ejemplo de Macro utilizado.

 

Código que se inserta en un módulo

‘**************https://macrosenexcel.com**** https://youtube.com/programarexcel*********

Sub EliminaFila()

Application.ScreenUpdating = False

On Error Resume Next

Set a = Sheets(«Hoja1»)

uf = Range(«A» & Rows.Count).End(xlUp).Row

For x = uf To 2 Step -1

If a.Cells(x, «A») = Empty Then a.Cells(x, «A»).EntireRow.Delete: conta = conta + 1

Next x

MsgBox («Se eliminaron » & conta & » registros»), vbInformation, «AVISO»

Application.ScreenUpdating = True

End Sub

 

Sub DeNuevo()

Set a = Sheets(«Hoja1»)

uf = Range(«A» & Rows.Count).End(xlUp).Row

a.Range(«A1:G» & uf).Clear

Sheets(«Hoja2»).Range(«A:G»).Copy Destination:=a.Range(«A1»)

MsgBox («Se copio la base de datos nuevamente»), vbInformation, «AVISO»

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.

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

Entradas relacionadas

Deja una respuesta

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

Comentarios (33)

Greate pieces. Keep posting such kind of information on your site.
Im really impressed by your blog.
Hello there, You’ve performed a great job. I’ll definitely digg it and in my opinion suggest to my friends.

I am confident they’ll be benefited from this web site.

Responder

Thanks for a marvelous posting! I certainly enjoyed reading
it, you will be a great author.I will be sure to bookmark your blog and will eventually come back very soon. I want to encourage one to continue your great posts,
have a nice afternoon!

Responder

Outstanding post however I was wondering if you could write a litte more on this subject?

I’d be very thankful if you could elaborate a little bit
more. Thank you!

Responder

Interesting blog! Is your theme custom made or did you download it from somewhere?
A theme like yours with a few simple tweeks would really make my blog stand out.
Please let me know where you got your design. Appreciate it

Responder

Hello, Neat post. There is an issue with your web site in web
explorer, might test this? IE still is the market leader and
a big component to people will omit your fantastic writing because of this problem.

Responder

Everyone loves what you guys tend to be up too. This sort of
clever work and reporting! Keep up the wonderful works guys I’ve you guys
to my own blogroll.

Responder

Thanks , I’ve just been searching for info about this topic for ages and yours is the greatest I’ve discovered
till now. But, what concerning the bottom line? Are you positive about the source?

Responder

Hey there would you mind sharing which blog platform you’re using?

I’m looking to start my own blog in the near future but I’m having
a tough time choosing between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your layout seems different then most blogs and I’m looking for something unique.

P.S My apologies for getting off-topic but I had to ask!

Responder

Hurrah, that’s what I was seeking for, what a data!
existing here at this blog, thanks admin of this site.

Responder

Hmm it looks like your website ate my first comment (it was super long) so I guess
I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog.
I as well am an aspiring blog blogger but I’m still new to the whole thing.
Do you have any helpful hints for newbie blog writers? I’d really appreciate it.

Responder

I am really loving the theme/design of your web site.

Do you ever run into any internet browser compatibility issues?
A couple of my blog readers have complained about my site not working correctly in Explorer but looks great in Chrome.
Do you have any advice to help fix this problem?

Responder

Hi there very cool blog!! Guy .. Beautiful ..
Wonderful .. I will bookmark your site and take the feeds also?
I’m glad to find a lot of helpful info right here in the post, we want develop extra techniques in this
regard, thanks for sharing. . . . . .

Responder

Wow, wonderful weblog structure! How lengthy have
you ever been running a blog for? you make blogging glance easy.
The total look of your site is magnificent, as smartly as the content material!

Responder

Yes! Finally someone writes about svu season 22.

Responder

Thank you for the auspicious writeup. It in fact was a amusement account it.
Look advanced to far added agreeable from you! By the way, how
could we communicate?

Responder

I for all time emailed this weblog post page to all my associates, because
if like to read it next my contacts will
too.

Responder

I every time used to study post in news papers but now as I am a user of net
thus from now I am using net for content, thanks to web.

Responder

I blog often and I truly appreciate your information. This article has truly peaked my
interest. I will book mark your site and keep checking for new details about
once a week. I subscribed to your RSS feed as well.

Responder

You’re so interesting! I do not suppose I have read through anything like that before.

So good to discover another person with some original thoughts on this topic.
Seriously.. thanks for starting this up. This web site is
something that’s needed on the internet, someone with some originality!

Responder

My family all the time say that I am wasting my time here at
net, however I know I am getting knowledge all the time by reading such fastidious articles
or reviews.

Responder

Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates.
I’ve been looking for a plug-in like this for quite some time and
was hoping maybe you would have some experience with something like this.
Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new
updates.

Responder

I’m not that much of a internet reader to be honest
but your blogs really nice, keep it up! I’ll go ahead
and bookmark your site to come back later. Many thanks

Responder

Pretty! This was a really wonderful article.
Thanks for providing this info.

Responder

Hi there, You have done a fantastic job. I will certainly digg it
and personally recommend to my friends. I am sure they’ll be benefited
from this web site.

Responder

I am actually happy to read this website posts which includes tons of valuable data, thanks for providing these statistics.

Responder

Woah! I’m really loving the template/theme of this
site. It’s simple, yet effective. A lot of times it’s hard to get that «perfect balance» between superb usability and
visual appearance. I must say you have done a superb job with this.
Additionally, the blog loads super fast for me on Firefox.

Exceptional Blog!

Responder

It’s remarkable to pay a visit this web page and reading the views of all friends concerning this paragraph, while I am also eager of getting knowledge.

Responder

I do not even know how I ended up here, however I thought this put
up used to be great. I don’t understand who you’re however definitely you are going to a famous blogger if you are not
already. Cheers!

Responder

This is my first time pay a visit at here and i am actually pleassant to read everthing at alone place.

Responder

Hi this is kinda of off topic but I was wondering if blogs use WYSIWYG editors or if you have
to manually code with HTML. I’m starting a blog soon but have no coding expertise so I wanted to
get advice from someone with experience. Any help would be enormously appreciated!

Responder

This text is worth everyone’s attention. How can I find out more?

Responder

This info is worth everyone’s attention. How can I find out more?

Responder

fantastic points altogether, you just received
a new reader. What would you recommend about your
put up that you made some days in the past? Any certain?

Responder