Saltar al contenido
PROGRAMAR EN VBA MACROS DE EXCEL

Insertar columnas

Insertar columnas con VBA  ó macros, me preguntaron en un foro de Excel como se insertaban columnas teniendo en cuenta los meses del año, como así también que el informe original no otorgara datos de meses en los cuales no había movimientos, por ello era necesario agregar columnas en base a los meses que faltaban y a su vez se tenía  que rellenar con ceros, en este ejemplo se insertan tantas columnas como sean necesarias  para que queden en orden correlativo del 1 al 12, simulando los meses, determina  cual es la última fila con valores de todas las columnas, en base a ello rellena hasta esa fila con ceros si no hay valor  que sea distinto de éste, en el link del final se encuentra el archivo que puedes descargar y adaptar a tus necesidades; te recomiendo que hagas click y leas un  excelente libro sobre el tema; aquí va el código:

Sub insertacol()
Application.ScreenUpdating = False
Dim fila, col, x, uf, ufmayor, dato As Integer
fila = 1
col = 1
x = 0
For x = 1 To 12
      dato = Sheets(«hoja1»).Cells(fila, x).Value
   If dato <> x Then
      Sheets(«hoja1»).Cells(fila, x).EntireColumn.Insert
      Sheets(«hoja1»).Cells(fila, x) = x
      Sheets(«hoja1»).Cells(fila, x).Select
    
      With Selection
           .NumberFormat = «000»
           .Font.Bold = True
      End With
   End If
   ‘col = col + 1
Next x
x = 0
For x = 1 To 12
     ‘Determino la última fila vacia
    uf = Sheets(«hoja1»).Cells(Rows.Count, x).End(xlUp).Row
    If uf > ufmayor Then
    ufmayor = uf
    End If
Next x
x = 0
‘Recorre columnas
For x = 1 To 12
     ‘Recorre filas
     For j = 2 To ufmayor
          ‘Determino cual es la columna que tiene la fila maxina de datos
          ‘Con ello se hasta donde rellenar con ceros, siempre que la celda este vacía
          If Sheets(«hoja1»).Cells(j, x) = Empty Then
             Sheets(«hoja1»).Cells(j, x) = 0
          End If
    Next j
   
Next x
Application.ScreenUpdating = False
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 (87)

Estimado apineda37 este ejemplo se adapta a lo que tu quiere hacer bájalo y adáptalo a tu hoja, luego me comentas

Responder

I’m the manager of JustCBD brand (justcbdstore.com) and I’m presently aiming to grow my wholesale side of business. I am hoping anybody at targetdomain share some guidance ! I thought that the very best way to do this would be to reach out to vape stores and cbd stores. I was really hoping if anyone could suggest a dependable site where I can purchase CBD Shops B2B Email Marketing List I am currently taking a look at creativebeartech.com, theeliquidboutique.co.uk and wowitloveithaveit.com. On the fence which one would be the most suitable option and would appreciate any assistance on this. Or would it be simpler for me to scrape my own leads? Suggestions?

Responder

Very good write-up. I definitely love this website. Stick with it!

Responder

When I originally left a comment I seem to have clicked 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. Perhaps there is a way you can remove me from that service? Cheers!

Responder

Good article! We are linking to this particularly great article on our site. Keep up the good writing.

Responder

May I simply say what a relief to find somebody that really understands what they’re discussing online. You actually know 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 was surprised that you’re not more popular given that you definitely possess the gift.

Responder

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

Responder

You are so awesome! I do not think I have read through a single thing like that before. So nice to discover another person with some unique thoughts on this issue. Really.. many thanks for starting this up. This web site is one thing that’s needed on the web, someone with a bit of originality!

Responder

Wonderful web site. A lot of useful info here. I am sending it to a few buddies ans also sharing in delicious.
And of course, thanks in your sweat!

Responder

I do not even know how I ended up here, but I thought this
post was great. I do not know who you are but certainly
you’re going to a famous blogger if you are not
already 😉 Cheers!

Responder

This article will assist the internet visitors for
creating new web site or even a blog from start to end.

adreamoftrains best web hosting 2020

Responder

I just want to tell you that I am beginner to blogs and actually savored this website. Likely I’m want to bookmark your blog post . You definitely have fantastic posts. Thanks a bunch for revealing your webpage.

Responder

I love your blog.. very nice colors & theme. Did you make this website yourself or did you hire someone to
do it for you? Plz reply as I’m looking to create my own blog and would like to know where u got this from.
thanks

Responder

I just want to tell you that I’m all new to blogs and honestly savored this website. More than likely I’m going to bookmark your blog . You definitely come with awesome article content. Bless you for revealing your website.

Responder

Hi, I do think this is an excellent website. I stumbledupon it 😉 I’m going to revisit once again since i have saved as a favorite it. Money and freedom is the best way to change, may you be rich and continue to guide others.

Responder

Oh my goodness! an amazing short article dude. Thanks However I am experiencing issue with ur rss. Don?t understand why Not able to subscribe to it. Is there any person getting the same rss trouble? Any person who knows kindly react. Thnkx

Responder

A remarkable share, I just offered this onto a colleague that was doing a little analysis on this. And he in fact acquired me breakfast due to the fact that I located it for him. smile. So let me rephrase that: Thnx for the treat! But yeah Thnkx for spending the moment to review this, I feel highly regarding it and love reading more on this topic. Ideally, as you become proficiency, would certainly you mind updating your blog site with even more information? It is extremely useful for me. Huge thumb up for this article!

Responder

pitkävetovihjeet

Responder

Exceptional post but I was wondering if you could write a litte more on this subject?
I’d be very grateful if you could elaborate a little bit more.
Cheers!

Responder

Insertar columnas – PROGRAMAR EN VBA MACROS DE EXCEL
aclmeficvg
clmeficvg http://www.g68m1018k29gt6y3qf6ar9tn4pkpm660s.org/
[url=http://www.g68m1018k29gt6y3qf6ar9tn4pkpm660s.org/]uclmeficvg[/url]

Responder

Shop; Unique Functions. Simple Product Layouts. Post with review. Advanced Product Layout. Best conversion pages. Frontend Search · Listing example …

Responder

It?s hard to discover experienced people on this subject, however you sound like you know what you?re speaking about! Thanks

Responder

Hello, Neat post. There is a problem together with your web site
in internet explorer, could check this? IE still is
the marketplace leader and a large section of other people will pass over your great writing because of this problem.
yynxznuh cheap flights

Responder

You ought to participate in a competition for one of the best blog sites on the web. I will certainly recommend this site!

Responder

Howdy, I do think your website could be having internet browser compatibility issues.
When I take a look at your blog in Safari, it looks fine however when opening in I.E.,
it’s got some overlapping issues. I just wanted to provide you
with a quick heads up! Other than that, excellent site!

Responder

I visited several sites but the audio quality
for audio songs present at this website is really fabulous.

Responder

There is noticeably a bundle to know about this. I presume you made certain wonderful factors in features also.

Responder

BUY CHEAP IBOGAINHow much ibogaine dosage should I take

Responder

Best view i have ever seen !

Responder

Love watching sunset !

Responder

Love watching sunset !

Responder

Love watching sunset !

Responder

Best view i have ever seen !

Responder

Love watching sunset !

Responder

ilmaiset videot, ilmaiset pornovideot, ilmaiset porno videot, porno video, porno videot

Responder

Oh my benefits! an impressive post man. Thanks Nonetheless I am experiencing problem with ur rss. Don?t recognize why Unable to register for it. Exists anybody getting identical rss problem? Anybody who recognizes kindly react. Thnkx

Responder

Heya i’m for the first time here. I came across this board and I find It really useful & it helped me out a lot. I hope to give something back and aid others like you helped me.

Responder

you’re really a good webmaster. The site loading speed is incredible. It seems that you’re doing any unique trick. In addition, The contents are masterpiece. you have done a magnificent job on this topic!

Responder

cbd oil

Responder

Your area is valueble for me. Many thanks !?

Responder

We are building consultants. We perform roof assessments, window testing, and wall testing for quality assurance on new and existing buildings.

Responder

netticasinot, netticasino, casino, kasinot, nettkasinot

Responder

This internet site is actually a walk-through for all of the information you wanted about this as well as didn?t understand that to ask. Glimpse below, and also you?ll definitely uncover it.

Responder

you’re really a good webmaster. The web site loading speed is incredible. It seems that you are doing any unique trick. Furthermore, The contents are masterwork. you have done a great job on this topic!

Responder

Hi my family member! I wish to say that this post is awesome, nice written and include almost all significant infos. I would like to look extra posts like this .

Responder

Thanks a lot for giving everyone an extremely breathtaking chance to read from this web site. It really is so kind plus packed with a lot of fun for me personally and my office colleagues to search your web site minimum three times a week to read the newest tips you have got. And indeed, I’m also usually astounded for the breathtaking knowledge you serve. Certain 4 areas in this article are truly the very best we have all had.

Responder

This design is incredible! You certainly know how to keep a reader amused. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Fantastic job. I really loved what you had to say, and more than that, how you presented it. Too cool!

Responder

Hey there! I just would love to give a big thumbs up for the excellent info you have here on this article. I will certainly be coming back to your blog for even more quickly.

Responder

Thank you a bunch for sharing this with all folks you really understand what you are talking approximately! Bookmarked. Please also consult with my web site =). We may have a link exchange contract between us!

Responder

Hey just wanted to give you a brief heads up and let you know a few of the images aren’t loading correctly. I’m not sure why but I think its a linking issue. I’ve tried it in two different internet browsers and both show the same results.

Responder

Tiger Zinda Hai movie down,Tiger Zinda Hai film movie,Tiger Zinda Hai movie tamil,Tiger Zinda Hai movie telugu,Tiger Zinda Hai full movie in hindi hd online,Tiger Zinda Hai full hd,Tiger Zinda Hai hindi mein,Tiger Zinda Hai full movie youtube,Tiger Zinda Hai songs tamil,Tiger Zinda Hai film,Tiger Zinda Hai song hindi,total collection of Tiger Zinda Hai,Tiger Zinda Hai malayalam,film Tiger Zinda Hai,Tiger Zinda Hai movie online,Tiger Zinda Hai mp3,Tiger Zinda Hai box office collection,Tiger Zinda Hai comedies,Tiger Zinda Hai comedy,Tiger Zinda Hai full movie on youtube,Tiger Zinda Hai hd movie,Tiger Zinda Hai song mp3,Tiger Zinda Hai movie video,Tiger Zinda Hai bengali movie,songs Tiger Zinda Hai a to z,Tiger Zinda Hai songs videos,Tiger Zinda Hai mp3 songs,Tiger Zinda Hai movie songs,Tiger Zinda Hai songs telugu,Tiger Zinda Hai tamil full movie,odia film Tiger Zinda Hai,box office collection of Tiger Zinda Hai,Tiger Zinda Hai full movie in tamil,Tiger Zinda Hai full movie in tamil tamilrockers,Tiger Zinda Hai movies,Tiger Zinda Hai full movie dailymotion,Tiger Zinda Hai telugu movie downloading,Tiger Zinda Hai telugu mp3 songs,Tiger Zinda Hai full hindi movie,Tiger Zinda Hai full movie,Tiger Zinda Hai south movie,Tiger Zinda Hai movie hd,Tiger Zinda Hai tamil full movie youtube,Tiger Zinda Hai full movie in hindi hd,Tiger Zinda Hai hindi full movie,Tiger Zinda Hai video songs,Tiger Zinda Hai release date,Tiger Zinda Hai director,Tiger Zinda Hai malayalam full movie,odia Tiger Zinda Hai,Tiger Zinda Hai song down,Tiger Zinda Hai tamil full movie tamilyogi,Tiger Zinda Hai movie hd downloading,aamir khan Tiger Zinda Hai,Tiger Zinda Hai cinema telugu,hindi picture film Tiger Zinda Hai,uwatchfree Tiger Zinda Hai,Tiger Zinda Hai hindi mai,Tiger Zinda Hai meaning,Tiger Zinda Hai world wide collection,Tiger Zinda Hai full movie down,Tiger Zinda Hai song hindi mai,Tiger Zinda Hai full movie online,Tiger Zinda Hai reviews,telugu Tiger Zinda Hai,Tiger Zinda Hai movie full,Tiger Zinda Hai ka film,Tiger Zinda Hai telugu film,Tiger Zinda Hai total collection,Tiger Zinda Hai odia film,Tiger Zinda Hai ki picture,Tiger Zinda Hai kannada movie,Tiger Zinda Hai full movie online watching,Tiger Zinda Hai collection,Tiger Zinda Hai song mp3 a to z,Tiger Zinda Hai video film,Tiger Zinda Hai writer,Tiger Zinda Hai full movie tamil,Tiger Zinda Hai kannada,Tiger Zinda Hai songs malayalam,bangla movie Tiger Zinda Hai,Tiger Zinda Hai telugu full movie,Tiger Zinda Hai hindi film,hindi Tiger Zinda Hai,Tiger Zinda Hai full movie video,Tiger Zinda Hai full movie in hindi,Tiger Zinda Hai telugu video songs,Tiger Zinda Hai ka song,Tiger Zinda Hai cinema,Tiger Zinda Hai telugu video,Tiger Zinda Hai trailer,hd Tiger Zinda Hai,Tiger Zinda Hai full movie telugu,Tiger Zinda Hai hd,hindi picture Tiger Zinda Hai,Tiger Zinda Hai telugu,Tiger Zinda Hai full movie hindi,Tiger Zinda Hai audio song,Tiger Zinda Hai full movie downloading,Tiger Zinda Hai the beginning,Tiger Zinda Hai full movie hd,Tiger Zinda Hai movie reviews,Tiger Zinda Hai full movie in telugu,Tiger Zinda Hai full hd video,Tiger Zinda Hai film hd,telugu Tiger Zinda Hai movies,Tiger Zinda Hai movie full hd downloading,Tiger Zinda Hai picture,Tiger Zinda Hai picture video,Tiger Zinda Hai movie online watching,Tiger Zinda Hai movie mp3 song downloading,producer of Tiger Zinda Hai,Tiger Zinda Hai all song,Tiger Zinda Hai fight,Tiger Zinda Hai girls,Tiger Zinda Hai poster,Tiger Zinda Hai full movie online youtube,Tiger Zinda Hai telugu movie,Tiger Zinda Hai tamil songs,Tiger Zinda Hai cast,Tiger Zinda Hai full movie hd hindi,Tiger Zinda Hai hindi movie,Tiger Zinda Hai hindi movies,Tiger Zinda Hai full movie youtube online in hindi,Tiger Zinda Hai mp3 song downloading,Tiger Zinda Hai full film,Tiger Zinda Hai song,Tiger Zinda Hai hindi picture,Tiger Zinda Hai sets,Tiger Zinda Hai mp3 songs downloading,online movies Tiger Zinda Hai,Tiger Zinda Hai movie,Tiger Zinda Hai movie in tamil,Tiger Zinda Hai tamil padam,Tiger Zinda Hai full movie watch online,wach online movie Tiger Zinda Hai,Tiger Zinda Hai movie full hd,Tiger Zinda Hai telugu songs,hindi song Tiger Zinda Hai,Tiger Zinda Hai movie in telugu,Tiger Zinda Hai hindi,Tiger Zinda Hai beginning,Tiger Zinda Hai hindi video,Tiger Zinda Hai full movie in hindi hd 1080p,Tiger Zinda Hai songs downloading,Tiger Zinda Hai cinema video,Tiger Zinda Hai telugu movie cinema,Tiger Zinda Hai film video,Tiger Zinda Hai first day collection,Tiger Zinda Hai casting,Tiger Zinda Hai Tiger Zinda Hai song,Tiger Zinda Hai film full movie,Tiger Zinda Hai tamil,Tiger Zinda Hai box office,Tiger Zinda Hai hindi songs,Tiger Zinda Hai tamil movie,Tiger Zinda Hai scene,wach online Tiger Zinda Hai,Tiger Zinda Hai film video mein,Tiger Zinda Hai full movie watch online dailymotion,Tiger Zinda Hai song Tiger Zinda Hai song,Tiger Zinda Hai movie songs downloading,Tiger Zinda Hai film song,Tiger Zinda Hai film hindi,hindi film Tiger Zinda Hai,Tiger Zinda Hai songs,hindi movie Tiger Zinda Hai,Tiger Zinda Hai hd video,Tiger Zinda Hai tamil movie downloading,Tiger Zinda Hai video,Tiger Zinda Hai story,Tiger Zinda Hai full hd movie,Tiger Zinda Hai movie downloading,Tiger Zinda Hai movie song,Tiger Zinda Hai songs list a to z,Tiger Zinda Hai mp3 song,Tiger Zinda Hai imdb,Tiger Zinda Hai movie youtube,Tiger Zinda Hai full movie hotstar,Tiger Zinda Hai downloading,Tiger Zinda Hai movie online hotstar,Tiger Zinda Hai telugu cinema,Tiger Zinda Hai video song,Tiger Zinda Hai full movie youtube online,Tiger Zinda Hai film Tiger Zinda Hai film,Tiger Zinda Hai picture movie

Responder

I uncovered your blog website on google and inspect a few of your early articles. Remain to maintain the very good run. I simply added up your RSS feed to my MSN News Viewers. Seeking onward to finding out more from you later!?

Responder

Thanks for sharing superb informations. Your site is so cool. I am impressed by the details that you’ve on this blog. It reveals how nicely you understand this subject. Bookmarked this web page, will come back for more articles. You, my pal, ROCK! I found simply the info I already searched all over the place and simply couldn’t come across. What a perfect site.

Responder

Very interesting information!Perfect just what I was looking for! «Music is a higher revelation than philosophy.» by Ludwig van Beethoven.

Responder

Great post however , I was wondering if you could write a litte more on this topic? I’d be very grateful if you could elaborate a little bit more. Bless you!

Responder

I am commonly to blog writing as well as i actually appreciate your material. The write-up has actually peaks my rate of interest. I am going to bookmark your site as well as keep checking for new details.

Responder

I cannot go a day without my my cbd salve!

https://infinitecbd.com/marijuana-plant/

Responder

Oh my benefits! an impressive short article guy. Thank you However I am experiencing problem with ur rss. Don?t understand why Unable to register for it. Is there anyone obtaining the same rss trouble? Anyone that understands kindly react. Thnkx

Responder

mba essay review service https://essaywritingservicenews.com/ – essay service cheap essay writing service discount code college essay writing service essay writing services for cheap

Responder

I wish to show my affection for your kind-heartedness supporting people who must have assistance with this one area. Your real dedication to getting the solution all over has been rather important and have in most cases helped men and women like me to attain their pursuits. Your personal important guide implies much a person like me and extremely more to my fellow workers. Best wishes; from each one of us.

Responder

coursework help uk https://courseworkhelpvra.com/ – coursework writer creative writing english coursework do my coursework coursework writer

Responder

i need help writing an argumentative essay https://essayhelptopp.com/ – i need help writing a compare and contrast essay romeo and juliet essay help cheap essay help online help me write essay

Responder

Aw, this was a truly nice blog post. In concept I would like to put in composing like this in addition? taking time and actual initiative to make an excellent short article? yet what can I state? I postpone alot as well as never seem to obtain something done.

Responder

cheap essays writing service https://essaywriterslop.com/ – custom essay writing service org essay online help essay on service scholarship essay writing service

Responder

auto essay writer https://essaywriterdodo.com/ – your essay writer college essay writers block professional essay writer college essay writer

Responder

write my paper online https://papersonlinesfy.com/ – cheapest paper writing service write my persuasive paper paper writing services for college students buying papers online college

Responder

custom admission essay https://customessayjojo.com/ – custom essay company custom essays usa custom essay writing sites cheap custom essay papers

Responder

write my admission essay https://essayonlinehdb.com/ – best essay website essay writers cheap buy an essay online cheap can you write my essay for me

Responder

dissertations writing services https://dissertationaas.com/ – phd dissertation dissertation template dissertation writing guide dissertation

Responder

payday loans online direct lenders only https://ausapaydayloans.com/ – online payday loans for bad credit payday loans oregon guaranteed payday loans no matter what quick payday loans

Responder

cheap viagra 100mg http://60lmentop.com/ – viagra without prescription buy viagra pills does generic viagra work buy viagra cheap

Responder

Your place is valueble for me. Thanks !?

Responder

I blog frequently and I truly thank you for your content. This article has truly peaked my interest. I will bookmark your site and keep checking for new information about once per week. I subscribed to your Feed too.

Responder

When I initially commented I clicked the -Alert me when brand-new comments are added- checkbox and also now each time a comment is added I get 4 e-mails with the very same remark. Is there any way you can remove me from that solution? Many thanks!

Responder

WOW just what I was looking for. Came here by searching
for mike tyson vs roy jones jr livestream full

Responder

Its like you read my mind! You appear to know so much about this, like you wrote the book in it or something. I think that you can do with some pics to drive the message home a bit, but other than that, this is magnificent blog. A great read. I will definitely be back.

Responder

Just wish to say your article is as surprising. The clarity in your post is simply excellent and i can assume you are an expert on this subject. Fine with your permission allow me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please carry on the rewarding work.

Responder

Thanks for any other magnificent post. Where else could anyone get that kind of info in such an ideal manner of writing?
I have a presentation next week, and I’m on the look for such information.

Responder

online payday loans direct lenders https://sapaydayiloans.com/ – guaranteed payday loans payday loans online same day deposit easy payday loans most trusted payday loans online

Responder

tadalafil online http://50cialmen.com/ – tadalafil cialis tadalafil 20 mg cialis for sale cialis coupon

Responder

Wow! This could be one particular of the most helpful blogs We’ve ever arrive across on this subject. Actually Great. I am also an expert in this topic therefore I can understand your effort.

Responder

viagra generic online http://45menvia.com/ – viagra canada viagra on line women viagra viagra for sale

Responder

Saved as a favorite, I love your website!

Responder

cialis reviews http://aazmencial.com/ – cheap tadalafil buy tadalafil 20mg price tadalafil cialis tadalafil cialis

Responder

Aw, this was a very nice post. Finding the time and actual effort to create a great article… but what can I say… I put things off a lot and never manage to get anything done.

Responder