Saltar al contenido
PROGRAMAR EN VBA MACROS DE EXCEL

Como Guardar con Password o Contraseña Copia Hoja Excel Activa


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

La macro que se muestra en este post permite crear una copia de la hoja actual o activa en otro libro de Excel guardando el libro con un password, contraseña o clave. En otras palabras hace una copia del la hoja activa y guarda el libro creado con la hoja copiada con password o contraseña.

En los siguientes post existen otras variantes sobre como guardar libros con password o contraseña mediante una macro, o que están relacionados con password o clave:
1) formulario que solicita password para ejecutar macro
2) leer el número de serie de la PC para dar acceso o no al Libro Excel
3) proteger archivo leyendo número de serie de la PC y ocultar hojas.

Desde el final del post se puede descargar el ejemplo en forma gratuita sin ninguna restricción, el código se puede adaptar a cada necesidad, Aporta por favor para sostener el sitio si está dentro de tus posibilidades, desde ya muchas gracias.

Si te estás iniciando en la operación de Excel o requieres afirmar conocimientos, 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.

  
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 textbox, como crear una factura o sale invoice y grabar guardar PDF XLS y enviar por mail, trabajando con filas, celdas, columnas, rangos 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);
}
}

 

La macro crea una copia de la hoja actual, para ello utiliza el siguiente código:

ActiveSheet.Copy

Al ejecutar el código anterior se verá como se crea una libro nuevo copiándose toda la hoja actual en el libro nuevo.

A través de estas variables se determina el nombre con el que se guardará el libro de Excel

nomarchi1 = ActiveWorkbook.Name
nom = Mid(nomarchi1, 1, InStr(nomarchi1, «.») – 1)
exte = «.xlsx»
ruta = ActiveWorkbook.Path & «» & nom & exte

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

Quizá sea de utilidad también

Como crear una factura con excel, guardarla y enviarla por mail automáticamente

Como enviar mail con archivo Excel y PDF mediante Outlook con Excel

Como hacer un link o hiperlink a google maps con Excel

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

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

Para guardar y proteger el libro de Excel nuevo password, contraseña o clave, se usa este código.

ActiveWorkbook.SaveAs Filename:=ruta, FileFormat:=xlOpenXMLWorkbook, Password:=»1234″, WriteResPassword:=»1234″

En el ejemplo se asigna la clave 1234, para probar su funcionamiento, abrir el libro de Excel creado y se podrá observar que se solicita un password para ingresar, colocar 1234 y se ingresará al libro, seguidamente se muestra la codificación completa, descargar el libro de ejemplo ayudará a comprender mejor el mismo.

Código que se inserta en un módulo

Sub GuardarPassword()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
On Error Resume Next
nomarchi1 = ActiveWorkbook.Name
nom = Mid(nomarchi1, 1, InStr(nomarchi1, «.») – 1)
exte = «.xlsx»
ruta = ActiveWorkbook.Path & «» & nom & exte
ActiveSheet.Copy
ActiveWorkbook.SaveAs Filename:=ruta, FileFormat:=xlOpenXMLWorkbook, Password:=»1234″, WriteResPassword:=»1234″
ActiveWorkbook.Close True
MsgBox («El archivo se guardo con éxito en » & ruta & » Password: 1234″), vbInformation, «AVISO»
Application.DisplayAlerts = True
Application.ScreenUpdating = True
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 (110)

I’m the proprietor of JustCBD Store brand (justcbdstore.com) and I’m presently looking to broaden my wholesale side of business. I really hope that anybody at targetdomain share some guidance 🙂 I thought that the very best way to accomplish this would be to reach out to vape companies and cbd retailers. I was hoping if anybody could suggest a qualified web-site where I can purchase Vape Shop Marketing Lead List I am already considering creativebeartech.com, theeliquidboutique.co.uk and wowitloveithaveit.com. Not exactly sure which one would be the most suitable choice and would appreciate any guidance on this. Or would it be easier for me to scrape my own leads? Ideas?

Responder

An intriguing discussion is definitely worth comment. I believe that you ought to write more on this subject matter, it may not be a taboo matter but typically people do not speak about these subjects. To the next! Cheers!!

Responder

An impressive share! I have just forwarded this onto a colleague who had been doing a little homework on this. And he actually bought me dinner because I stumbled upon it for him… lol. So let me reword this…. Thanks for the meal!! But yeah, thanx for spending some time to talk about this topic here on your web site.

Responder

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

Responder

A motivating discussion is definitely worth comment. I believe that you ought to publish more about this issue, it may not be a taboo matter but typically people don’t discuss such subjects. To the next! Many thanks!!

Responder

Having read this I believed it was very informative. I appreciate you finding the time and effort to put this information together. I once again find myself personally spending way too much time both reading and posting comments. But so what, it was still worth it!

Responder

Thanks for your marvelous posting! I seriously enjoyed reading
it, you can be a great author. I will be sure to bookmark your blog and will often come back in the future.
I want to encourage you to continue your great work,
have a nice evening!

Responder

I’m gone to tell my little brother, that he should also pay a visit
this blog on regular basis to take updated from newest information.
adreamoftrains webhosting

Responder

Asking questions are in fact pleasant thing if you
are not understanding anything totally, however this piece of writing provides pleasant understanding yet.

Responder

Way cool! Some extremely valid points! I appreciate you penning this article plus the rest of the website is also very good.

Responder

Howdy! I could have sworn I’ve visited this website before but after looking at many of the articles I realized it’s new to me. Regardless, I’m definitely pleased I found it and I’ll be book-marking it and checking back frequently!

Responder

Very good information. Lucky me I found your blog by accident (stumbleupon). I have saved it for later!

Responder

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

Responder

Spot on with this write-up, I really feel this website needs much more attention. I’ll probably be back again to see more, thanks for the information!

Responder

This blog was… how do I say it? Relevant!! Finally I’ve found something that helped me. Cheers!

Responder

You ought to take part in a contest for one of the finest sites online. I most certainly will highly recommend this website!

Responder

Achieving your fitness goal doesn’t need a certified personal trainer or an expensive gym memberships, it’s not hard to exercise at home. It’s easy to go down a training and fitness rabbit hole, however, when you’re looking for the best home exercise equipment to outfit your personal home gym.

Responder

Heya i am for the primary time here. I found this board and I find
It really helpful & it helped me out much. I hope to offer something again and aid
others such as you helped me. cheap flights yynxznuh

Responder

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

Responder

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

Responder

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

Responder

Very good info. Lucky me I recently found your blog by chance (stumbleupon). I have bookmarked it for later!

Responder

I like reading an article that can make men and women think. Also, many thanks for permitting me to comment!

Responder

Hi! I could have sworn I’ve been to this website before but after browsing through some of the post I
realized it’s new to me. Anyways, I’m definitely delighted I found it
and I’ll be book-marking and checking back frequently!

Responder

Next time I read a blog, Hopefully it does not fail me as much as this one. After all, I know it was my choice to read, nonetheless I actually believed you would have something useful to talk about. All I hear is a bunch of whining about something that you can fix if you were not too busy seeking attention.

Responder

You have made some decent points there. I looked on the internet to learn more about the issue and found most individuals will go along with your views on this site.

Responder

Oh my goodness! Incredible article dude! Thank you, However I am going through issues with your RSS. I don’t understand why I can’t join it. Is there anybody else having similar RSS problems? Anyone that knows the answer can you kindly respond? Thanx!!

Responder

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

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 blog often and I truly appreciate your content. Your article has really peaked my interest. I am going to take a note of your site and keep checking for new information about once per week. I opted in for your RSS feed as well.

Responder

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

Responder

Spot on with this write-up, I actually feel this web site needs a lot more attention. I’ll probably be back again to see more, thanks for the information!

Responder

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

Responder

Way cool! Some extremely valid points! I appreciate you penning this post plus the rest of the website is also really good.

Responder

Thank you for sharing superb informations. Your web site is very cool. I’m impressed by the details that you’ve on this site. It reveals how nicely you understand this subject. Bookmarked this web page, will come back for extra articles. You, my pal, ROCK! I found just the information I already searched everywhere and just could not come across. What an ideal website.

Responder

Hi there, I do believe your web site might be having web browser compatibility problems. When I take a look at your web site in Safari, it looks fine however when opening in IE, it has some overlapping issues. I just wanted to provide you with a quick heads up! Besides that, excellent website!

Responder

Excellent article. I’m facing many of these issues as well..

Responder

Oh my goodness! Amazing article dude! Thank you, However I am encountering problems with your RSS. I don’t understand why I cannot join it. Is there anybody else having similar RSS problems? Anybody who knows the answer can you kindly respond? Thanx!!

Responder

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

Responder

Pretty nice post. I just stumbled upon your blog and wanted to say that I have truly enjoyed surfing around your blog posts. In any case I’ll be subscribing to your rss feed and I hope you write again very soon!

Responder

I precisely wished to appreciate you once again. I’m not certain the things that I could possibly have carried out without the type of basics shown by you concerning this area. It was actually a real hard circumstance in my opinion, nevertheless taking note of a new specialised style you dealt with the issue took me to leap for contentment. Now i am grateful for this assistance and thus hope you know what an amazing job you’re carrying out educating many others thru your websites. I am sure you’ve never met all of us.

Responder

Very good article. I will be facing a few of these issues as well..

Responder

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

Responder

Hi, I do think this is an excellent website. I stumbledupon it 😉 I may revisit yet again since I book marked it. Money and freedom is the greatest way to change, may you be rich and continue to guide others.

Responder

Ephesians 1:3 Blessed be the God and Father of our Lord Jesus Christ, who has blessed us in Christ with every spiritual blessing in the heavenly places.

Responder

Today, while I was at work, my cousin stole my iPad 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 broken and she has 83 views. I know this is totally off topic but I had to share it with someone!

Responder

I constantly spent my haf an hour to read this blog’s articles or reviews all the tine along with a cup of coffee.|

Responder

Your style is unique in comparison to other people I have read stuff from. Thanks for posting when you’ve got the opportunity, Guess I’ll just book mark this page.

Responder

Very good post. I definitely love this site. Stick with it!

Responder

Everyone loves it when folks get together and share ideas. Great website, keep it up!

Responder

Excellent article. I absolutely appreciate this website. Stick with it!

Responder

I’m still learning from you, as I’m trying to achieve my goals. I certainly liked reading all that is written on your website.Keep the stories coming. I enjoyed it!

Responder

A motivating discussion is worth comment. I do believe that you should publish more about this subject matter, it might not be a taboo subject but generally people don’t talk about such topics. To the next! Many thanks!!

Responder

I used to be able to find good info from your blog posts.

Responder

I’ve been absent for a while, but now I remember why I used to love this blog. Thanks , I will try and check back more often. How frequently you update your site?

Responder

I blog frequently and I truly thank you for your information. This great article has truly peaked my interest. I am going to take a note of your blog and keep checking for new information about once per week. I opted in for your Feed too.

Responder

This site was… how do I say it? Relevant!! Finally I’ve found something that helped me. Thanks!

Responder

You’re so cool! I don’t suppose I’ve truly read anything like that before. So good to find someone with a few unique thoughts on this subject. Really.. many thanks for starting this up. This website is one thing that’s needed on the internet, someone with a little originality!

Responder

My brother recommended I might like this website. He was entirely right. This post actually made my day. You can not imagine simply how much time I had spent for this info! Thanks!

Responder

very good publish, i certainly love this website, keep on it

Responder

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

Responder

Very nice article. I certainly appreciate this website. Continue the good work!

Responder

That is really attention-grabbing, You’re a very professional blogger. I’ve joined your feed and sit up for seeking extra of your excellent post. Also, I’ve shared your web site in my social networks!

Responder

I appreciate, cause I found exactly what I was looking for. You have ended my 4 day long hunt! God Bless you man. Have a nice day. Bye

Responder

Hello! I just wish to offer you a big thumbs up for the great information you’ve got here on this post. I will be returning to your website for more soon.

Responder

Hey just wanted to let you know that your content is very impressive, also Youre writing is wicked!, thanks again.

Responder

Very good post. I absolutely love this website. Keep writing!

Responder

Hi, I do think this is a great website. I stumbledupon it 😉 I will come back once again since I book-marked it. Money and freedom is the best way to change, may you be rich and continue to guide other people.

Responder

obviously like your web-site but you have to take a look at the spelling on quite a few of your posts. Many of them are rife with spelling problems and I to find it very bothersome to tell the reality however I will certainly come again again.

Responder

There is definately a great deal to learn about this topic. I love all of the points you’ve made.

Responder

This is the right web site for everyone who really wants to understand this topic. You realize a whole lot its almost hard to argue with you (not that I actually would want to…HaHa). You certainly put a brand new spin on a topic that has been written about for years. Great stuff, just excellent!

Responder

Greetings, There’s no doubt that your web site could be having internet browser compatibility problems. Whenever I take a look at your site in Safari, it looks fine however, if 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 blog!

Responder

It’s hard to come by experienced people in this particular subject, however, you seem like you know what you’re talking about! Thanks

Responder

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

Responder

Iím impressed, I need to say. Really not often do I encounter a blog thatís each educative and entertaining, and let me tell you, you could have hit the nail on the head. Your idea is excellent; the problem is one thing that not enough persons are talking intelligently about. I am very pleased that I stumbled across this in my search for something referring to this.

Responder

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

Responder

When I originally commented 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 can remove me from that service? Cheers!

Responder

My partner and so i stumbled over here coming from a different
website address and thought I might too check things out.
I love a few things i see so i am just just following you.
Look forward to looking over your online page repeatedly.

Also visit my homepage :: ExieBTaliulu

Responder

Aw, this was a very nice post. In idea I want to put in writing like this additionally – taking time and precise effort to make a very good article… however what can I say… I procrastinate alot and on no account seem to get one thing done.

Responder

Hey just wanted to give you a quick heads up. The text in your content seem to be running off the screen in Internet explorer. I’m not sure if this is a format issue or something to do with web browser compatibility but I thought I’d post to let you know. The style and design look great though! Hope you get the issue fixed soon. Cheers

Responder

Keep functioning ,remarkable job!

Responder

You need to participate in a contest for the most effective blogs on the web. I will recommend this site!

Responder

Very good info. Lucky me I ran across your site by chance (stumbleupon). I have bookmarked it for later!

Responder

Thanks , I have recently been looking for information about this topic for ages and yours is the greatest I have discovered so far. But, what about the bottom line? Are you sure about the source?

Responder

The very next time I read a blog, Hopefully it does not disappoint me just as much as this particular one. I mean, Yes, it was my choice to read through, but I truly thought you would have something helpful to say. All I hear is a bunch of complaining about something that you can fix if you weren’t too busy seeking attention.

Responder

Thanks a bunch for one more valuable post. Ive been checking this website frequently for the past number of months, and its currently one of my favorite sites! . I work on an internet site that has very similar content, would you’ve got any interest write a guest post on it? Shoot me an email if you are interested!

Responder

Hello! Would you mind if I share your blog with my zynga group? There’s a lot of people that I think would really enjoy your content. Please let me know. Cheers

Responder

I wanted to put you that bit of word to be able to say thank you as before for your amazing concepts you’ve provided in this case. It is quite open-handed of people like you to supply unhampered what exactly a number of people could have marketed as an e book to earn some bucks for their own end, chiefly considering that you could possibly have done it if you decided. Those ideas as well worked to be a good way to be certain that other individuals have similar zeal really like my own to grasp more and more with regards to this condition. I’m sure there are some more pleasurable situations in the future for individuals who see your blog post.

Responder

This is a topic which is near to my heart… Many thanks! Where are your contact details though?

Responder

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

Responder

hi. I observe that you were focused on creating quality backlinks and stuff. I’m merchandising scrapebox auto approve link lists. If you’d like to trade ?

Responder

It is really a nice and useful piece of info. I am happy that you just shared this helpful info with us. Please keep us informed like this. Thanks for sharing.

Responder

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

Responder

I was on Twitter looking for Neiko Tools Air Tools when I found a link to this blog, happy I stopped by – Cheers

Responder

Spot on with this write-up, I actually think this site needs a lot more attention. I’ll probably be back again to see more, thanks for the info!

Responder

It is the best time to make a few plans for the future and it’s time to be happy. I have read this publish and if I may I wish to suggest you few fascinating issues or suggestions. Perhaps you could write subsequent articles referring to this article. I desire to learn more issues approximately it!

Responder

Greetings! This is my 1st comment here so I just wanted to give a quick shout out and tell you I really enjoy reading your posts. Can you recommend any other blogs/websites/forums that cover the same subjects? Thanks!

Responder

Today, while I was at work, my sister stole my iPad and tested to see if it can survive a thirty foot drop, just so she can be a youtube sensation. My iPad is now destroyed and she has 83 views. I know this is entirely off topic but I had to share it with someone!

Responder

Hi! I simply would like to give you a big thumbs up for your excellent info you have got right here on this post. I’ll be coming back to your web site for more soon.

Responder

my dad is a massage therapist and he can really relieve minor pains and injuries’

Responder

Great blog you’ve got here.. It’s hard to find high-quality writing like yours nowadays. I seriously appreciate people like you! Take care!!

Responder

I do enjoy the way you have presented this particular situation plus it does indeed offer us some fodder for thought. However, from just what I have personally seen, I basically trust when the actual remarks pile on that folks keep on point and in no way get started upon a tirade of some other news of the day. Yet, thank you for this fantastic point and while I do not really agree with the idea in totality, I regard your viewpoint.

Responder

I like looking through a post that will make people think. Also, thank you for allowing me to comment!

Responder

Wow, wonderful blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your web site is great, let alone the content!

Responder

Everything is very open with a very clear description of the challenges. It was definitely informative. Your website is useful. Thanks for sharing!

Responder

There is certainly a lot to find out about this subject. I like all the points you made.

Responder

Can I just now say that of a relief to get somebody who actually knows what theyre speaking about on the web. You actually realize how to bring an issue to light and produce it important. Workout . need to look at this and fully grasp this side on the story. I cant think youre no more common because you definitely contain the gift.

Responder

This is a really good tip particularly to those fresh to the blogosphere. Short but very precise information… Thank you for sharing this one. A must read post!

Responder

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

Responder

Hi there! I just wanted to ask if you ever have any issues with hackers? My last blog (wordpress) was hacked and I ended up losing several weeks of hard work due to no data backup. Do you have any solutions to protect against hackers?

Responder