Saltar al contenido
PROGRAMAR EN VBA MACROS DE EXCEL

Vistas Diseño de Impresión Normal Salto Página

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

Si estás usando macros para automatizar tu libro de Excel seguramente te es necesario saber seleccionar o referenciar celdas, en FORMAS DE SELECCIONAR O REFERENCIAR CELDAS CON VBA (Spanish Edition) encontrarás una excelente ayuda; si trabajas con fechas en Excel, fíjate en el siguiente link que te puede ser de utilidad FORMATOS Y FUNCIONES DE FECHA Y HORA DE MICROSOFT EXCEL (Spanish Edition)
 
En un pos anterior se presentó una macro para configurar una hoja de Excel, como así también macro para imprimir hoja de Excel y de esta forma automatizar la configuración de impresión, quedando al alcance de un clik y evitar todo un trabajo tedioso y engorroso como es tener que configurar una hoja antes de imprimir, en este tutorial, pequeño peor útil, te muestro como seleccionar mediante código las distintas vistas que tiene Excel.

Te recomiendo que leas un excelente libro sobre Excel el que te ayudará operar las planillas de cálculo, haz click acá, si quieres un libro sobre Excel, en inglés, entonces debes hacer click acá. 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.

Excel tiene varios modos de vista:

Vista Normal
Vista Previa de Impresión
Vista de salto de página
Vista diseño de página
Vista pantalla completa

Es posible en alguna macro que necesitemos determinada vista para ellos debemos saber el código necesario 

Con el código siguiente lo que obtenemos es una vista normal de Excel, es decir la que estamos acostumbrados a ver cuando iniciamos la aplicación, ver figura siguiente. 
ActiveWindow.View = xlNormalView 

Con el código siguiente lo que obtenemos es una de diseño de página de Excel, ver figura siguiente. 
ActiveWindow.View = xlPageLayoutView

El siguiente código sirve para obtener una vista de salto de página de Excel, ver la figura siguiente
ActiveWindow.View = xlPageBreakPreview

Con los códigos siguientes se obtiene ve la vista previa de impresión, cualquier de las dos formas llevan al mismo resultado, ver la imagen siguiente.
Application.Dialogs(xlDialogPrintPreview).Show
ThisWorkbook.PrintPreview

El código siguiente activa la vista pantalla completa, esto se realiza con True con False se sale de pantalla completa.

Application.DisplayFullScreen = True

Application.DisplayFullScreen = False

Se ha expuesto en el código que abajo un muy pequeño ejemplo que permite configurar una página y al final obtener una vista de diseño de página de Excel. Si copias y pegas el código en un módulo de VBA verás como resultado que la macro configura la hoja de Excel modificando los margenes izquierdo, derecho, superior, inferior, de encabezado y pie de página, selecciona o configura la página para que se impriman los encabezados y líneas de división. Posterior a ello activa la vista diseño de página.

En el siguiente vídeo de Youtube se muestra una explicación más detallada.

Código que se inserta en un módulo

    Application.PrintCommunication = False
    With ActiveSheet.PageSetup
        .LeftMargin = Application.InchesToPoints(0.708661417322835)
        .RightMargin = Application.InchesToPoints(0.708661417322835)
        .TopMargin = Application.InchesToPoints(0.748031496062992)
        .BottomMargin = Application.InchesToPoints(0.748031496062992)
        .HeaderMargin = Application.InchesToPoints(0.31496062992126)
        .FooterMargin = Application.InchesToPoints(0.31496062992126)
        .PrintHeadings = True
        .PrintGridlines = True
     End With
    Application.PrintCommunication = True
    ActiveWindow.View = xlPageLayoutView
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 una respuesta

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

Comentarios (32)

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

Responder

This paragraph will assist the internet viewers for
building up new blog or even a blog from start to end.

Responder

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

Responder

Wonderful goods from you, man. I’ve understand your stuff previous to and you’re
just extremely excellent. I actually like what you’ve acquired here,
really like what you’re stating and the way in which you say it.
You make it entertaining and you still care for
to keep it smart. I can’t wait to read much
more from you. This is really a terrific site.

Responder

An interesting discussion is definitely worth comment. I believe that you ought to write more on this issue, it may not be a
taboo matter but typically people do not discuss these topics.

To the next! Many thanks!!

Responder

It’s difficult to find educated people about this subject,
however, you seem like you know what you’re talking about!
Thanks

Responder

great submit, very informative. I wonder why the opposite specialists of this sector do
not notice this. You should continue your writing.
I’m confident, you’ve a great readers’ base already!

Responder

It’s remarkable to pay a quick visit this site and reading
the views of all colleagues concerning this article, while
I am also eager of getting knowledge.

Responder

Good day I am so excited I found your web site, I really found you by accident, while I was browsing on Bing for something else, Anyhow I am here now and would just like to say thanks a lot for a remarkable post and a all round thrilling blog (I also love the theme/design), I don’t
have time to look over it all at the minute but
I have saved it and also included your RSS feeds, so when I have time I will be
back to read more, Please do keep up the fantastic b.

Responder

I am genuinely thankful to the holder of this website who
has shared this enormous article at here.

Responder

If some one needs expert view about blogging and site-building after
that i suggest him/her to go to see this web site, Keep up the fastidious job.

Responder

We’re a group of volunteers and starting a new scheme in our community.

Your web site offered us with valuable information to work on. You have done a formidable
job and our entire community will be thankful to you.

Responder

I think the admin of this web page is in fact working hard
for his web site, because here every material is quality based information.

Responder

These are actually great ideas in about blogging. You have touched some fastidious points here.
Any way keep up wrinting.

Responder

Hmm is anyone else encountering problems with the images on this
blog loading? I’m trying to determine if its a problem on my end or if it’s the blog.

Any feedback would be greatly appreciated.

Responder

Magnificent beat ! I wish to apprentice while you amend your website, how could i subscribe for
a blog site? The account aided me a acceptable deal.
I had been a little bit acquainted of this your broadcast provided bright clear idea

Responder

My spouse and I stumbled over here different
page and thought I should check things out. I like what I see so now i’m following you.
Look forward to checking out your web page yet again.

Responder

Greetings! This is my 1st comment here so I just wanted to give a quick shout
out and say I genuinely enjoy reading your articles.
Can you suggest any other blogs/websites/forums that deal with the same
subjects? Many thanks!

Responder

What i do not realize is in truth how you are no longer really
much more well-appreciated than you may be now. You are so intelligent.
You know therefore significantly on the subject of this topic, produced me for my part consider it from a lot of various
angles. Its like men and women don’t seem to be interested except it is something
to accomplish with Woman gaga! Your own stuffs nice. All the time maintain it up!

Responder

always i used to read smaller articles that also clear their
motive, and that is also happening with this paragraph which
I am reading now.

Responder

It’s really a cool and useful piece of information. I
am glad that you just shared this helpful info with us.

Please keep us up to date like this. Thank you for sharing.

Responder

I wanted to thank you for this great read!! I definitely enjoyed every bit of it.
I’ve got you saved as a favorite to look at new stuff you post…

Responder

Just desire to say your article is as surprising.
The clearness in your post is just excellent and i
could assume you’re an expert on this subject.
Well with your permission let me to grab your RSS feed to keep
up to date with forthcoming post. Thanks a million and
please carry on the gratifying work.

Responder

Hey there, You’ve done an incredible job. I’ll definitely digg
it and personally recommend to my friends. I am sure they’ll be benefited
from this website.

Responder

Somebody necessarily lend a hand to make significantly posts I’d state.
That is the very first time I frequented your web page and to this point?
I amazed with the analysis you made to make this particular
submit extraordinary. Great job!

Responder

Very good post! We are linking to this great post on our
site. Keep up the great writing.

Responder

whoah this weblog is great i really like studying your posts.

Keep up the good work! You recognize, many individuals are hunting around for this information, you
could help them greatly.

Responder

Hello friends, good piece of writing and good urging commented here, I am genuinely enjoying
by these.

Responder

It’s difficult to find educated people on this subject, however,
you seem like you know what you’re talking about!
Thanks

Responder

We’re a group of volunteers and starting a new scheme in our community.

Your web site provided us with valuable information to work on. You’ve done
an impressive job and our whole community will be grateful to
you.

Responder

An impressive share! I’ve just forwarded this onto a coworker
who had been doing a little homework on this. And he
in fact bought me lunch simply because I discovered it for him…
lol. So let me reword this…. Thanks for the meal!!
But yeah, thanks for spending some time to discuss this issue here on your web
site.

Responder

Wow, this article is pleasant, my younger sister is analyzing these things, therefore I am going to let know her.

Responder