Docsity
Docsity

Prepara tus exámenes
Prepara tus exámenes

Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity


Consigue puntos base para descargar
Consigue puntos base para descargar

Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium


Orientación Universidad
Orientación Universidad

Ejemplos de Macros en Excel: Copiar filas, enviar correos electrónicos y más, Esquemas y mapas conceptuales de Logística

Bases de datos en ExcelProgramación en VBAAutomatización de Excel

Aquí se presentan ejemplos básicos de macros para tareas de automatización comunes en excel. Encontrarás macros para copiar y pegar una fila de una hoja a otra, enviar correos electrónicos, listar todas las hojas de un librito, ocultar y mostrar hojas, proteger y desproteger hojas y eliminar formas y filas en blanco.

Qué aprenderás

  • ¿Cómo se puede enviar un correo electrónico desde una macro en Excel?
  • Cómo copiar una fila de una hoja a otra usando una macro en Excel?
  • ¿Cómo se puede listar todas las hojas de un librito de Excel usando una macro?

Tipo: Esquemas y mapas conceptuales

2019/2020

Subido el 11/11/2022

liceth-paniagua-murillo
liceth-paniagua-murillo 🇧🇴

1 documento

1 / 4

Toggle sidebar

Documentos relacionados


Vista previa parcial del texto

¡Descarga Ejemplos de Macros en Excel: Copiar filas, enviar correos electrónicos y más y más Esquemas y mapas conceptuales en PDF de Logística solo en Docsity! Excel Macro Examples Below you will find a list of basic macro examples for common Excel automation tasks. Copy and Paste a Row from One Sheet to Another This super simple macro will copy a row from one sheet to another. Sub Paste_OneRow() 'Copy and Paste Row Sheets("sheet1").Range("1:1").Copy Sheets("sheet2").Range("1:1") Application.CutCopyMode = False End Sub Send Email This useful macro will launch Outlook, draft an email, and attach the ActiveWorkbook. Sub Send_Mail() Dim OutApp As Object Dim OutMail As Object Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) With OutMail .to = "test@test.com" .Subject = "Test Email" .Body = "Message Body" .Attachments.Add ActiveWorkbook.FullName .Display End With Set OutMail = Nothing Set OutApp = Nothing End Sub List All Sheets in Workbook This macro will list all sheets in a workbook. Sub ListSheets() Dim ws As Worksheet Dim x As Integer x = 1 ActiveSheet.Range("A:A").Clear For Each ws In Worksheets ActiveSheet.Cells(x, 1) = ws.Name x = x + 1 Next ws End Sub Unhide All Worksheets This macro will unhide all worksheets. ' Unhide All Worksheets Sub UnhideAllWoksheets() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets ws.Visible = xlSheetVisible Next ws End Sub Hide All Worksheets Except Active This macro will hide all worksheets except the active worksheet. ' Hide All Sheets Except Active Sheet Sub HideAllExceptActiveSheet() Dim ws As Worksheet For Each ws In ThisWorkbook.Worksheets If ws.Name <> ActiveSheet.Name Then ws.Visible = xlSheetHidden Next ws End Sub Unprotect All Worksheets This macro example will unprotect all worksheets in a workbook. ' UnProtect All Worksheets Sub UnProtectAllSheets() Dim ws As Worksheet For Each ws In Worksheets ws.Unprotect "password" Next ws End Sub Protect All Worksheets This macro will protect all worksheets in a workbook. ' Protect All Worksheets Sub ProtectAllSheets()
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved