0% found this document useful (0 votes)
6 views2 pages

Sub Workbook

The document contains VBA macros for Excel that manage workbook visibility and formatting, including hiding the ribbon, formula bar, and workbook tabs on open, and restoring them on close. It also includes functions to delete entire rows, print selected sheets, delete empty rows, and export sheets as PDF files to specified locations. The macros are designed to streamline user interaction with the Excel workbook and automate document generation.

Uploaded by

gdeivson7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Sub Workbook

The document contains VBA macros for Excel that manage workbook visibility and formatting, including hiding the ribbon, formula bar, and workbook tabs on open, and restoring them on close. It also includes functions to delete entire rows, print selected sheets, delete empty rows, and export sheets as PDF files to specified locations. The macros are designed to streamline user interaction with the Excel workbook and automate document generation.

Uploaded by

gdeivson7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Sub Workbook_Open()

Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"

Application.DisplayFormulaBar = False

Application.DisplayStatusBar = Not Application.DisplayStatusBar

ActiveWindow.DisplayWorkbookTabs = False

End Sub

Sub Workbook_Off()

Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",true)"

Application.DisplayFormulaBar = True

Application.DisplayStatusBar = Not Application.DisplayStatusBar

ActiveWindow.DisplayWorkbookTabs = True

End Sub

Sub DeleteEntireRow()

Selection.EntireRow.Delete

End Sub

Sub PDF()

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _

"C:\Users\deivson\Desktop\Controle EPI.pdf", Quality:=xlQualityStandard, _

IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _

True

End Sub

Sub iMPR()

Range("D3").Select

ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _

IgnorePrintAreas:=False

Range("D3").Select

End Sub
Sub deletarLinhasVazias() Dim ultimalinha, r As Integer ultimalinha =
ActiveSheet.UsedRange.Row - 1 + _ ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False For r = ultimalinha To 1 Step -1 If
Application.CountA(Rows(r)) = 0 Then Rows(r).Delete End If Next r End Sub

Sub PDF_VAMOS_GERAR()

Dim PastaNome As String

PastaNome = "C:\Users\User\OneDrive - REFRAMAX\Desktop\AVALIACAO\" &


Range("C5").Value & ".pdf"

Range("C5").Select

ChDir "C:\Users\User\OneDrive - REFRAMAX\Desktop\AVALIACAO"

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _

PastaNome, Quality:= _

xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _

OpenAfterPublish:=False

End Sub

You might also like