Saltar al contenido
PROGRAMAR EN VBA MACROS DE EXCEL

Como Eliminar Filas en Base a Color de Fuente #490

Eliminar filas en excel

En este post se muestra Como Eliminar Filas en Excel en Base a Color de Fuente, la macro de Excel recorre todas las filas en busca de las celdas cuya fuente tenga un color determinado, en caso de coincidir con el criterio de búsqueda elimina la fila de Excel completa.

La macro permite quitar o suprimir filas en base a un criterio que en el caso del ejemplo es el color de la fuente, la macro de Excel recorre desde la primer a la última fila con datos en busca de las filas de excel a eliminar.

Para manejar Excel en forma eficiente 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, te lo recomiendo no te arrepentirás.

El vídeo verás la macro en acción con una explicación más detallada de su codificación y funcionamiento, 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 Recorre fila buscando y comparando datos de dos columnas en hojas distintasbuscar en listbox mientras escribes en textboxcomo crear una factura o sale invoice y grabar guardar PDF XLS y enviar por mailtrabajando con filas, celdas, columnas, rangos y muchos ejemplos más.

En que consite el ejemplo que suprime filas en base a criterio color de fuente

El ejemplo se puede descargar en forma gratuita desde el final del post, la macro recorre, todas las filas de Excel, en este ejemplo va de la fila 2 a la filas 65.000, buscando datos cuyo color de fuente esta dado por el color del fondo de la celda H1, en este ejemplo, rojo.

Las celdas de la columna A son las que la macro evalúa para determinar si cumple con el criterio para eliminar filas en Excel, es decir que el color de la fuente sea rojo, en ese caso eliminará la fila de Excel en forma completa.

Explicación del código de Excel – VBA que permite quitar filas dependiendo del color del texto

En primer lugar la macro determina la última fila con datos para poder establecer el bucle desde que celda hasta que celda debe recorrer, eso se hace de la siguiente forma:

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

Luego procede a realizar un bucle recorriendo las filas de de la última con datos hasta la fila 2 que es la primer fila con datos, es decir recorre las filas de abajo hacia arriba , el código es el siguiente:

For x = uf To 2 Step -1
If a.Cells(x, «A»).Font.Color = colo Then a.Cells(x, «A»).EntireRow.Delete: conta = conta + 1
Next x

Posteriormente por cada una de las filas recorridas por el bucle se determina si el color ce fuente de la celda analizada coincide con el color rojo que es el criterio para eliminar las filas y cuyo número de color fue guardado en la variable «colo», en caso de coincidir el color del texto con el criterio, procede a eliminar la fila en excel, el código que se utiliza es:

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

Notese que la variable conta, irá contando la cantidad de registros eliminados para luego al final aparezca un Msgbox que muestra la cantidad de registros eliminados.

Código que se inserta en un módulo de Excel – VBA

Sub EliminaFila()
Application.ScreenUpdating = False
On Error Resume Next
Set a = Sheets(«Hoja1»)
uf = Range(«A» & Rows.Count).End(xlUp).Row
colo = a.Cells(1, «H»).Interior.Color
For x = uf To 2 Step -1
If a.Cells(x, «A»).Font.Color = colo 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.

Donate:
Paypal: https://paypal.me/programarexcel
Bitcoin: 1KBGGb8fyDzyR3X1Rie6m7VguzaAfngNbd
Ether: 0x41Bbd24556914C83a31217eBb3BC49789b66e407

Summary
Author Rating
1star1star1star1star1star
Aggregate Rating
5 based on 1 votes

Deja un comentario

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

Comentarios (130)

I’m the co-founder of JustCBD company (justcbdstore.com) and I am currently aiming to grow my wholesale side of business. I am hoping someone at targetdomain is able to provide some guidance ! I considered that the best way to accomplish this would be to reach out to vape stores and cbd stores. I was really hoping if anybody could suggest a reliable site where I can buy CBD Shops Sales Leads I am already taking a look at creativebeartech.com, theeliquidboutique.co.uk and wowitloveithaveit.com. Not exactly sure which one would be the most suitable choice and would appreciate any advice on this. Or would it be simpler for me to scrape my own leads? Ideas?

Responder

тонкость процедуры субсидиарная ответственность или смежная процедура закрыть фирму с долгами

Responder

You need to be a part of a contest for one of the highest quality blogs online. I will recommend this site!

Responder

I love it when individuals get together and share thoughts. Great site, stick with it!

Responder

This is the perfect webpage for anyone who wishes to find out about this topic. You understand a whole lot its almost hard to argue with you (not that I personally will need to…HaHa). You certainly put a fresh spin on a subject which has been discussed for decades. Great stuff, just excellent!

Responder

Hello there! This article could not be written any better! Reading through this post reminds me of my previous roommate! He continually kept talking about this. I am going to send this article to him. Fairly certain he’s going to have a good read. Many thanks for sharing!

Responder

Good day! I could have sworn I’ve been to this website before but after looking at a few of the articles I realized it’s new to me. Anyhow, I’m certainly happy I came across it and I’ll be book-marking it and checking back often!

Responder

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

Responder

A fascinating discussion is worth comment. I do think that you ought to write more on this subject, it might not be a taboo subject but usually folks don’t discuss such subjects. To the next! Cheers!!

Responder

Everything is very open with a very clear clarification of the issues. It was definitely informative. Your website is extremely helpful. Thank you for sharing!

Responder

Oh my goodness! Incredible article dude! Many thanks, However I am having difficulties with your RSS. I don’t know why I cannot subscribe to it. Is there anyone else having similar RSS issues? Anyone that knows the answer will you kindly respond? Thanx!!

Responder

Great info. Lucky me I discovered your blog by chance (stumbleupon). I have book marked it for later!

Responder

Pretty! This was an incredibly wonderful article. Thanks for supplying these details.

Responder

It’s nearly impossible to find well-informed people in this particular subject, however, you seem like you know what you’re talking about! Thanks

Responder

After going over a handful of the blog posts on your site, I truly appreciate your technique of writing a blog. I saved it to my bookmark website list and will be checking back soon. Please visit my web site too and let me know your opinion.

Responder

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

Responder

I was able to find good advice from your blog articles.

Responder

I blog often and I truly thank you for your content. Your article has truly peaked my interest. I will book mark your website and keep checking for new details about once per week. I subscribed to your Feed too.

Responder

I absolutely love your site.. Pleasant colors & theme. Did you make this amazing site yourself? Please reply back as I’m looking to create my own personal blog and would like to find out where you got this from or just what the theme is named. Many thanks!

Responder

I’m amazed, I must say. Seldom do I come across a blog that’s both equally educative and entertaining, and without a doubt, you’ve hit the nail on the head. The problem is something that too few people are speaking intelligently about. I’m very happy I came across this in my hunt for something concerning this.

Responder

You’re so interesting! I do not suppose I’ve truly read through anything like this before. So great to find somebody with genuine thoughts on this subject. Really.. many thanks for starting this up. This site is something that is required on the internet, someone with a bit of originality!

Responder

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

Responder

This is the right website for everyone who hopes to understand this topic. You understand so much its almost tough to argue with you (not that I actually would want to…HaHa). You definitely put a new spin on a topic which has been written about for ages. Great stuff, just wonderful!

Responder

This page definitely has all the info I wanted concerning this subject and didn’t know who to ask.

Responder

After going over a handful of the blog articles on your web site, I truly like your way of blogging. I added it to my bookmark site list and will be checking back in the near future. Take a look at my web site as well and let me know your opinion.

Responder

Great blog! Is your theme custom made or did you download it from somewhere?

A design like yours with a few simple adjustements would really make my
blog stand out. Please let me know where you got your design. Cheers

Responder

Great beat ! I wish to apprentice whilst you amend your site,
how could i subscribe for a weblog website?
The account helped me a appropriate deal. I had been tiny bit acquainted
of this your broadcast offered vivid clear concept adreamoftrains web hosting companies

Responder

Terrific post however I was wondering if you could write a litte more on this topic?
I’d be very thankful if you could elaborate a little bit further.
Appreciate it!

Responder

I love reading through a post that can make men and women think. Also, thank you for allowing me to comment!

Responder

Good day! This is my first comment here so I just wanted to give a quick
shout out and say I genuinely enjoy reading through your articles.
Can you recommend any other blogs/websites/forums
that cover the same topics? Appreciate it!

Here is my webpage LannieWYeddo

Responder

Greetings! Very useful advice within this post! It’s the little changes that make the most significant changes. Thanks for sharing!

Responder

Way cool! Some very valid points! I appreciate you writing this article plus the rest of the site is really good.

Responder

Pretty! This was a really wonderful post. Thank you for providing these details.

Responder

This website was… how do you say it? Relevant!! Finally I have found something that helped me. Kudos!

Responder

Yes! Finally something about web hosting.

Responder

This is the right web site for everyone who would like to understand this topic. You realize a whole lot its almost tough to argue with you (not that I actually would want to…HaHa). You definitely put a new spin on a subject which has been written about for years. Wonderful stuff, just wonderful!

Responder

Hi, I do believe this is a great site. I stumbledupon it 😉 I may return yet again since i have book-marked it. Money and freedom is the greatest way to change, may you be rich and continue to guide other people.

Responder

After exploring a few of the blog posts on your web page, I truly appreciate your way of blogging. I book marked it to my bookmark website list and will be checking back in the near future. Take a look at my website as well and let me know your opinion.

Responder

You are so awesome! I do not believe I have read through something like that before. So great to find someone with some original thoughts on this topic. Really.. many thanks for starting this up. This website is one thing that’s needed on the web, someone with a bit of originality!

Responder

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

Responder

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, nonetheless I genuinely thought you would have something interesting to talk about. All I hear is a bunch of whining about something you can fix if you weren’t too busy searching for attention.

Responder

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

Responder

This website was… how do I say it? Relevant!! Finally I’ve found something which helped me. Appreciate it!

Responder

I enjoy reading an article that can make people think. Also, thank you for allowing me to comment!

Responder

Spot on with this write-up, I truly feel this website needs far more attention. I’ll probably be back again to read through more, thanks for the information!

Responder

You’re so cool! I do not suppose I have read through something like that before. So wonderful to discover somebody with some genuine thoughts on this topic. Seriously.. many thanks for starting this up. This site is something that is required on the internet, someone with some originality!

Responder

Howdy! This blog post could not be written any better! Reading through this article reminds me of my previous roommate! He continually kept talking about this. I will forward this post to him. Fairly certain he will have a very good read. I appreciate you for sharing!

Responder

Saved as a favorite, I really like your web site!

Responder

I’m amazed, I have to admit. Seldom do I encounter a blog that’s both equally educative and interesting, and let me tell you, you have hit the nail on the head. The issue is something too few people are speaking intelligently about. I’m very happy that I came across this during my hunt for something relating to this.

Responder

Your style is very unique compared to other people I have read stuff from. Thank you for posting when you’ve got the opportunity, Guess I will just book mark this site.

Responder

I’m very happy to find this site. I want to to thank you for your time for this particularly fantastic read!! I definitely liked every part of it and I have you saved to fav to see new things in your website.

Responder

After I initially commented I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I recieve four emails with the same comment. Is there a way you can remove me from that service? Appreciate it!

Responder

Can I simply just say what a comfort to find a person that really understands what they are talking about on the internet. You actually realize how to bring an issue to light and make it important. More and more people ought to check this out and understand this side of your story. I can’t believe you are not more popular since you definitely possess the gift.

Responder

Howdy, I think your website could possibly be having web browser compatibility issues. When I take a look at your website in Safari, it looks fine however, if opening in Internet Explorer, it’s got some overlapping issues. I merely wanted to provide you with a quick heads up! Other than that, great blog!

Responder

Greetings! Very useful advice within this post! It is the little changes which will make the greatest changes. Thanks for sharing!

Responder

There is definately a great deal to find out about this issue. I love all the points you have made.

Responder

I was wondering if you ever thought of changing the structure of your website?
Its very well written; I love what youve got to say.
But maybe you could a little more in the way of content so people could connect
with it better. Youve got an awful lot of text for only having one
or 2 images. Maybe you could space it out better?

Responder

It’s difficult to find well-informed people on this topic, but you seem like you know what you’re talking about! Thanks

Responder

I was able to find good information from your blog articles.

Responder

Good post. I learn something new and challenging on websites I stumbleupon on a daily basis.
It will always be helpful to read through content from other authors and use a little something from
other web sites. 3aN8IMa cheap flights

Responder

After I initially left a comment I appear to have clicked on the -Notify me when new comments are added- checkbox and now whenever a comment is added I recieve 4 emails with the exact same comment. There has to be a means you can remove me from that service? Kudos!

Responder

I’m very pleased to discover this web site. I need to to thank you for your time for this fantastic read!! I definitely really liked every bit of it and i also have you saved to fav to check out new information on your blog.

Responder

After I initially left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and now every time a comment is added I receive four emails with the same comment. Perhaps there is a way you are able to remove me from that service? Cheers!

Responder

This is a topic that is close to my heart… Take care! Exactly where are your contact details though?

Responder

You ought to take part in a contest for one of the best websites on the web. I will highly recommend this blog!

Responder

I think that is among the such a lot important
information for me. And i’m satisfied studying your article.
However wanna observation on some normal issues, The website taste is great, the articles is in reality excellent : D.
Good job, cheers

Responder

Pretty! This has been an extremely wonderful post. Many thanks for providing this information.

Responder

Oh my goodness! Incredible article dude! Many thanks, However I am having problems with your RSS. I don’t know the reason why I am unable to join it. Is there anybody else getting identical RSS issues? Anyone who knows the answer will you kindly respond? Thanks!!

Responder

490 ❤️ Como Eliminar Filas en ? Base a Color de Fuente 2019 #490
[url=http://www.gi65bfmuj8c2191904yql4ct3h76u1b7s.org/]uqgbssngzg[/url]
aqgbssngzg
qgbssngzg http://www.gi65bfmuj8c2191904yql4ct3h76u1b7s.org/

Responder

We tested coffee makers for the water temperature during the brew cycle and the brewing time as well as the temperature of the coffee at the end of brewing and during the keep warm cycle. In addition, we evaluated each brewer’s ease of use, including how easy it was to read and use the controls, access the water tank and brew basket, read the markings on the tank and carafe, whether or not it had automatic keep warm and shut off cycles, and the ease of cleaning the carafe.

Responder

I really like it whenever people get together and share thoughts. Great site, stick with it!

Responder

This web site truly has all the information and facts I needed about this subject and didn’t know who to ask.

Responder

Hello! I simply want to give you a huge thumbs up for the excellent info you have got here on this post. I am coming back to your blog for more soon.

Responder

Very good blog post. I definitely appreciate this website. Thanks!

Responder

You are so awesome! I don’t think I’ve truly read through a single thing like this before. So good to find somebody with original thoughts on this topic. Really.. thanks for starting this up. This web site is something that is required on the internet, someone with a bit of originality!

Responder

This is a topic that’s close to my heart… Cheers! Exactly where are your contact details though?

Responder

I’ve read some good stuff here. Certainly worth bookmarking for revisiting. I surprise how much effort you put to create such a wonderful informative website.

Responder

You’ve made some good points there. I looked on the internet to learn more about the issue and found most people will go along with your views on this website.

Responder

Iíll immediately clutch your rss as I can not to find your email subscription link or e-newsletter service. Do you have any? Please permit me recognise in order that I could subscribe. Thanks.

Responder

Great post. I am facing some of these issues as well..

Responder

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

Responder

You are so awesome! I don’t believe I’ve truly read through something like that before. So nice to find someone with some unique thoughts on this subject. Seriously.. thank you for starting this up. This site is something that is needed on the internet, someone with some originality!

Responder

Hi, I do think this is an excellent web site. I stumbledupon it 😉 I may return once again since i have book-marked it. Money and freedom is the best way to change, may you be rich and continue to help other people.

Responder

Next time I read a blog, Hopefully it doesn’t disappoint me as much as this particular one. After all, I know it was my choice to read, but I really thought you would have something interesting to talk about. All I hear is a bunch of crying about something you could fix if you were not too busy seeking attention.

Responder

You need to be a part of a contest for one of the greatest blogs on the web. I will highly recommend this website!

Responder

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

Responder

Iím not sure where you’re getting your information, but good topic. I needs to spend some time learning more or understanding more. Thanks for great info I was looking for this info for my mission.

Responder

Hi, I do believe this is a great blog. I stumbledupon it 😉 I am going to revisit once again since I bookmarked it. Money and freedom is the greatest way to change, may you be rich and continue to guide other people.

Responder

Pretty! This was a really wonderful post. Thank you for your provided information.

Responder

You could certainly see your expertise in the work you write. The sector hopes for even more passionate writers like you who are not afraid to say how they believe. At all times go after your heart.

Responder

There is certainly a great deal to learn about this issue. I love all of the points you have made.

Responder

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

Responder

Very good information. Lucky me I came across your site by chance (stumbleupon). I’ve saved it for later!

Responder

I’m impressed, I must say. Seldom do I come across a blog that’s equally educative and entertaining, and without a doubt, you have hit the nail on the head. The problem is an issue that not enough people are speaking intelligently about. I am very happy that I found this during my hunt for something relating to this.

Responder

A fascinating discussion is worth comment. I do think that you ought to write more on this subject matter, it might not be a taboo matter but usually folks don’t speak about such topics. To the next! Cheers!!

Responder

I really like reading an article that can make men and women think. Also, thank you for allowing for me to comment!

Responder

Hi there, I do think your site may be having web browser compatibility issues. When I look at your blog in Safari, it looks fine however, if opening in I.E., it has some overlapping issues. I just wanted to give you a quick heads up! Other than that, great website!

Responder

Hello there! I just want to offer you a big thumbs up for the great information you have right here on this post. I am returning to your web site for more soon.

Responder

Wonderful site. Plenty of useful information here. I am sending it to a few pals ans additionally sharing in delicious. And obviously, thank you for your effort!

Responder

I want to to thank you for this great read!! I definitely enjoyed every bit of it. I have got you bookmarked to check out new stuff you post…

Responder

Greetings, There’s no doubt that your site could possibly be having browser compatibility issues. Whenever I look at your blog in Safari, it looks fine however, when opening in I.E., it’s got some overlapping issues. I merely wanted to provide you with a quick heads up! Other than that, wonderful blog!

Responder

Very nice article. I definitely appreciate this site. Keep writing!

Responder

I’m amazed, I must say. Seldom do I encounter a blog that’s equally educative and engaging, and without a doubt, you have hit the nail on the head. The issue is an issue that too few folks are speaking intelligently about. Now i’m very happy that I came across this in my hunt for something relating to this.

Responder

You should take part in a contest for one of the greatest websites on the web. I most certainly will highly recommend this blog!

Responder

Having read this I thought it was rather enlightening. I appreciate you finding the time and energy to put this article together. I once again find myself personally spending a lot of time both reading and posting comments. But so what, it was still worth it!

Responder

You made some good points there. I looked on the web for more info about the issue and found most individuals will go along with your views on this website.

Responder

Oh my goodness! Amazing article dude! Many thanks, However I am having issues with your RSS. I don’t know why I cannot subscribe to it. Is there anyone else having identical RSS issues? Anybody who knows the solution will you kindly respond? Thanx!!

Responder

GScraper

Responder

hey there and many thanks for your info – I have certainly gathered anything new from here.
I did however expertise some technical points employing this website, as I experienced
to reload the website a lot of times previous to I was able to obtain it to load properly.
I was wondering in case your web host is OK? Not that I am just complaining,
but slow loading instances times will sometimes affect
your placement in the search engines and could damage your quality score
if advertising and marketing with Adwords. Well I’m adding this RSS to my e-mail and can look out for much even more
of your respective exciting content. Be sure you update this
again soon.

Feel free to surf to my web-site – SonnyFNeeson

Responder

Nice post. I learn something new and challenging on blogs I stumbleupon on a daily basis. It’s always exciting to read content from other writers and practice a little something from their websites.

Responder

Oh my goodness! Awesome article dude! Thank you so much, However I am going through issues with your RSS. I don’t understand why I can’t subscribe to it. Is there anyone else getting similar RSS issues? Anyone that knows the answer will you kindly respond? Thanks!!

Responder

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

Responder

I’m amazed, I have to admit. Seldom do I encounter a blog that’s equally educative and amusing, and let me tell you, you’ve hit the nail on the head. The problem is an issue that too few people are speaking intelligently about. Now i’m very happy that I came across this in my search for something concerning this.

Responder

I’m amazed, I must say. Seldom do I encounter a blog that’s equally educative and amusing, and without a doubt, you’ve hit the nail on the head. The problem is something that too few men and women are speaking intelligently about. Now i’m very happy that I came across this in my hunt for something relating to this.

Responder

I need to to thank you for this wonderful read!! I absolutely enjoyed every bit of it. I have you book-marked to look at new stuff you post…

Responder

It’s hard to find experienced people about this topic, however, you sound like you know what you’re talking about! Thanks

Responder

Wonderful post! We are linking to this great post on our website. Keep up the great writing.

Responder

This page truly has all of the information and facts I needed about this subject and didn’t know who to ask.

Responder

Having read this I believed it was very informative. I appreciate you spending some time and effort to put this information together. I once again find myself personally spending a lot of time both reading and commenting. But so what, it was still worthwhile!

Responder

Aw, this was an extremely nice post. Taking a few minutes and actual effort to produce a top notch article… but what can I say… I put things off a whole lot and never seem to get anything done.

Responder

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

Responder

Hi there! I could have sworn I’ve visited this website before but after looking at many of the posts I realized it’s new to me. Anyhow, I’m definitely pleased I discovered it and I’ll be book-marking it and checking back regularly!

Responder

I’d like to thank you for the efforts you have put in writing this blog. I am hoping to see the same high-grade blog posts by you in the future as well. In fact, your creative writing abilities has motivated me to get my own website now 😉

Responder

I blog often and I really appreciate your information. The article has truly peaked my interest. I will take a note of your blog and keep checking for new details about once per week. I subscribed to your Feed too.

Responder

I’m very pleased to find this website. I want to to thank you for your time for this particularly wonderful read!! I definitely liked every part of it and I have you bookmarked to see new information on your web site.

Responder

Good blog post. I definitely love this website. Keep writing!

Responder