Views

...

Important:

Quaisquer soluções e/ou desenvolvimento de aplicações pessoais, ou da empresa, que não constem neste Blog podem ser tratados como consultoria freelance.

E-mails

Deixe seu e-mail para receber atualizações...

eBook Promo

DICA VBA: Livros 2011

Acredito que sempre é importante olhar para os lados, percebendo as técnicas e dimensão que estas têm alcançado sob a perita batuta de outros mestres do VBA. Seguem alguns títulos de livros que acho muito proveitoso para ampliar a nossa compreensão do ambiente VBA e sua arquitetura.

Comprem e leiam o máximo de títulos possível, além de buscar tais autores como referência no desenvolvimento e implementação.

Título: Microsoft Office Home and Student 2007
Produto da: Microsoft

Título: Excel 2007 Power Programming with VBA
Autor: John Walkenbach
Nº de Páginas: 1104

Título: Excel 2007 Formulas
Autor: John Walkenbach
Nº de Páginas: 840

Título: Access 2007 VBA Programmer's Reference
Autores: Teresa Hennig, Rob Cooper, Geoffrey L. Griffith, Armen Stein
Nº de Páginas: 1152

Título: Microsoft Visual Basic 2005 Step by Step
Autor: Michael Halvorson
Nº de Páginas: 608

Título: VBA and Macros for Microsoft Office Excel 2007
Autores: Bill Jelen e Tracy Syrstad
Nº de Páginas: 624

Título: Programming Excel with VBA and .NET 
Autores: Jeff Webb e Steve Saunders
Nº de Páginas: 1114

Título: Integrating Excel and Access
Autor: Michael Schmalz
Nº de Páginas: 232

Título: VBA for Modelers: Developing Decision Support Systems Using Microsoft® Excel 
Autor: S. Christian Albright
Nº de Páginas: 204

Título: Visual Studio Tools for Office 2007: VSTO for Excel, Word, and Outlook
Autores: Eric Carter e Eric Lippert
Nº de Páginas: 1120

Título: Pro Office 2007 Development with VSTO
Autor: Ty Anderson
Nº de Páginas: 320

Título: VSTO for Mere Mortals(TM): A VBA Developer's Guide to MS Office Development Using VSTO
Autores: Paul Stubbs e Kathleen McGrath
Nº de Páginas: 736

Título: Beginning Office 2007 Development with VSTO 
Autor: Vivek Thangaswamy
Nº de Páginas: 300

Título: Word 2007 Document Automation with VBA and VSTO 
Autor: Scott Driza
Nº de Páginas: 500

Título: Excel 2007 Bible
Autor: John Walkenbach
Nº de Páginas: 912

Título: Office 2007 All-in-One Desk Reference For Dummies
Autor: Peter Weverka
Nº de Páginas: 816

Título: Excel 2007 VBA Programming For Dummies
Autor: John Walkenbach
Nº de Páginas: 368

Título: iWork '09: The Missing Manual
Autor: Josh Clark
Nº de Páginas: 850

Tags: Bernardes, MS, Microsoft, Office, VBA, Armen Stein, Bill Jelen, Eric Carter, Eric Lippert, Geoffrey L. Griffith, Jeff Webb, John Walkenbach, Josh Clark, Kathleen McGrath, Michael Halvorson, Michael Schmalz, Paul Stubbs, Peter Weverka, Rob Cooper, S. Christian Albright, Scott Driza, Steve Saunders, Teresa Hennig, Tracy Syrstad, Ty Anderson, Vivek Thangaswamy

André Luiz Bernardes
A&A® - Work smart, not hard.
Skype: inanyplace 


DICA EXCEL - Aumentando a velocidade de inicialização do seu MS Excel - Speed up Excel Start up (FASTER EXCEL)

Qual é a sua versão do MS Office?
Já se perguntou por que o seu startup está tão lento no MS Excel? Mesmo que esteja trabalhando com a melhor placa-mãe e o melhor processador disponível no mercado. Talvez já tenha tentado diversas coisas, mas sem sucesso. Então, tente este, embora seja um dos truques, que vai economizar muito do seu tempo.

Uma das razões da espera é que a barra de ferramentas que tende a crescer muito, pois este arquivo é carregado quando se inicia o MS Excel. A extensão deste arquivo da barra de ferramentas é XLB, a localização padrão é "Dados de Aplicativos \ Microsoft \ Excel \" e o tamanho normal é entre 10 a 90 KB. O problema surge quando este tamanho atinge em 1 megabytes (MB).

Solução: Exclua todos os arquivos xlb a partir destes locais:

Usuários do Windows 98 -> "C: \ Windows \ Application Data \ Microsoft \ Excel \ *. XLB excel"
Usuários do Windows 98SE/NT/ME -> "C: \ Windows \ Profiles \ username \ Application Data \ Microsoft \ Excel \ *. XLB excel"
Usuários do Windows 2000/XP -> "C: \ Documents and Settings \ username \ Application Data \ Microsoft \ Excel \ *. XLB excel"
Windows 7 Users -> "C: \ Users \ USERNAME \ AppData \ Microsoft \ Excel \ *. XLB excel"

O USERNAME é seu nome de usuário do sistema. Por favor, altere os valores em conformidade.

Detalhe importante: Não existe almoço grátis. Os arquivos XLB são re-criados automaticamente, você vai perder todas as suas personalizações da barra de ferramentas (ou as configurações do menu pessoal).

Sub Speedup_Excel()
  Dim fso

  On Error Resume Next

  Set fso = CreateObject("Scripting.FileSystemObject")

  'Delete excel.xlb. If not exists goto next
  fso.DeleteFile VBA.Environ("appdata") &  "\Microsoft\Excel\excel*.xlb"

  'Clean up
  Set fso = Nothing
End Sub


André Luiz Bernardes
A&A® - Work smart, not hard.
Skype: inanyplace 


DICA Excel - Tornando suas planilhas menores - SHRINK REDUCE EXCEL FILE SIZE

Já aconteceu de você ter uma planilha de uns 5 ou 6 MB, a qual você efetuar algumas atualizações, talvez criando alguns gráficos, e algumas tabelas dinâmicas, vê essa planilha aumentar de tamanho de 3 a 100 vezes! Ficou surpreso? Sim porque é possível, então não se preocupe demais, vou ajudá-lo.

Bem, em primeiro lugar precisamos entender a diferença entre Excel Default Last Cell e Actual Last Cell. Quando pressionamos Ctrl + End para encontrar a última célula (Actual Last Cell), nós chegamos a Excel Default Last Cell, que pode ser a Actual Last Cell ou podem ser células vazias que ficam muito além desta. Quanto mais distante da Excel Default Last Cell estiver a Actual Last Cell mais espaço desnecessário está sendo ocupado na planilha atual.

Qual a solução? Apague todas as linhas e colunas além do Actual Last Cell em cada planilha. Se houver demasiadas planilhas e grandes conjuntos de dados, poderá usar o código VBA a seguir:

Option Explicit

Sub SHRINK_XL()
    Dim WSheet As Worksheet
    Dim CSheet As String 'New Worksheet
    Dim OSheet As String 'Old WorkSheet
    Dim Col As Long
    Dim ECol As Long 'Last Column
    Dim lRow As Long
    Dim BRow As Long 'Last Row
    Dim Pic As Object
   
    For Each WSheet In Worksheets
        WSheet.Activate
         'Put the sheets in a variable to make it easy to go back and forth
        CSheet = WSheet.Name
         'Rename the sheet to its name with _Delete at the end
        OSheet = CSheet & "_Delete"
        WSheet.Name = OSheet
         'Add a new sheet and call it the original sheets name
        Sheets.Add
        ActiveSheet.Name = CSheet
        Sheets(OSheet).Activate
         'Find the bottom cell of data on each column and find the further row
        For Col = 1 To Columns.Count 'Find the actual last bottom row
            If Cells(Rows.Count, Col).End(xlUp).Row > BRow Then
                BRow = Cells(Rows.Count, Col).End(xlUp).Row
            End If
        Next
       
         'Find the end cell of data on each row that has data and find the furthest one
        For lRow = 1 To BRow 'Find the actual last right column
            If Cells(lRow, Columns.Count).End(xlToLeft).Column > ECol Then
                ECol = Cells(lRow, Columns.Count).End(xlToLeft).Column
            End If
        Next
       
         'Copy the REAL set of data
        Range(Cells(1, 1), Cells(BRow, ECol)).Copy
        Sheets(CSheet).Activate
         'Paste Every Thing
        Range("A1").PasteSpecial xlPasteAll
         'Paste Column Widths
        Range("A1").PasteSpecial xlPasteColumnWidths

        Sheets(OSheet).Activate
        For Each Pic In ActiveSheet.Pictures
            Pic.Copy
            Sheets(CSheet).Paste
            Sheets(CSheet).Pictures(Pic.Index).Top = Pic.Top
            Sheets(CSheet).Pictures(Pic.Index).Left = Pic.Left
        Next Pic
        Sheets(CSheet).Activate
       
         'Reset the variable for the next sheet
        BRow = 0
        ECol = 0
    Next WSheet
   
     ' Since, Excel will automatically replace the sheet references for you on your formulas,
     ' the below part puts them back.
     ' This is done with a simple replace, replacing _Delete with nothing
    For Each WSheet In Worksheets
        WSheet.Activate
        Cells.Replace "_Delete", ""
    Next WSheet
   
    'Roll through the sheets and delete the original fat sheets
    For Each WSheet In Worksheets
        If Not Len(Replace(WSheet.Name, "_Delete", "")) = Len(WSheet.Name) Then
            Application.DisplayAlerts = False
            WSheet.Delete
            Application.DisplayAlerts = True
        End If
    Next
End Sub

Tags: Bernardes, MS, Microsoft, Office, VBA, Sheet, woksheet, shrink, diminuir, reduce, compact, size, file, planilha, arquivo

André Luiz Bernardes
A&A® - Work smart, not hard.
Skype: inanyplace 

VBA Excel - Mostra todas as fontes disponíveis para o MS Excel - Display all installed fonts

Quantas fontes estão disponíveis para serem utilizadas ? Descubra.

Sub ShowInstalledFonts()

Const StartRow As Integer = 4

Dim FontNamesCtrl As CommandBarControl, FontCmdBar As CommandBar, tFormula As String

Dim fontName As String, i As Long, fontCount As Long, fontSize As Integer

    fontSize = 0

    fontSize = Application.InputBox("Enter Sample Font Size Between 8 And 30", _

         "Select Sample Font Size", 12, , , , , 1)

    If fontSize = 0 Then Exit Sub

    If fontSize < 8 Then fontSize = 8

    If fontSize > 30 Then fontSize = 30

    Set FontNamesCtrl = Application.CommandBars("Formatting").FindControl(ID:=1728)

    ' If Font control is missing, create a temp CommandBar

    If FontNamesCtrl Is Nothing Then

        Set FontCmdBar = Application.CommandBars.Add("TempFontNamesCtrl", _

            msoBarFloating, False, True)

        Set FontNamesCtrl = FontCmdBar.Controls.Add(ID:=1728)

    End If

    Application.ScreenUpdating = False

    fontCount = FontNamesCtrl.ListCount

    Workbooks.Add

    ' list font names in column A and font example in column B

    For i = 0 To FontNamesCtrl.ListCount - 1

        fontName = FontNamesCtrl.List(i + 1)

        Application.StatusBar = "Listing font " & _

            Format(i / (fontCount - 1), "0 %") & " " & _

            fontName & "..."

        Cells(i + StartRow, 1).Formula = fontName

        With Cells(i + StartRow, 2)

            tFormula = "abcdefghijklmnopqrstuvwxyz"

            If Application.International(xlCountrySetting) = 47 Then

                tFormula = tFormula & "æøå"

            End If

            tFormula = tFormula & UCase(tFormula)

            tFormula = tFormula & "1234567890"

            .Formula = tFormula

            .Font.Name = fontName

        End With

    Next i

    Application.StatusBar = False

    If Not FontCmdBar Is Nothing Then FontCmdBar.Delete

    Set FontCmdBar = Nothing

    Set FontNamesCtrl = Nothing

    ' add heading

    Columns(1).AutoFit

    With Range("A1")

        .Formula = "Installed fonts:"

        .Font.Bold = True

        .Font.Size = 14

    End With

    With Range("A3")

        .Formula = "Font Name:"

        .Font.Bold = True

        .Font.Size = 12

    End With

    With Range("B3")

        .Formula = "Font Example:"

        .Font.Bold = True

        .Font.Size = 12

    End With

    With Range("B" & StartRow & ":B" & _

        StartRow + fontCount)

        .Font.Size = fontSize

    End With

    With Range("A" & StartRow & ":B" & _

        StartRow + fontCount)

        .VerticalAlignment = xlVAlignCenter

    End With

    Range("A4").Select

    ActiveWindow.FreezePanes = True

    Range("A2").Select

    ActiveWorkbook.Saved = True

End Sub


Tags: Bernardes, MS, Microsoft, Office, Excel, show, fonts,

André Luiz Bernardes
A&A® - Work smart, not hard in any place.
Skype: inanyplace 


eBooks VBA na AMAZOM.com.br

LinkWithinBrazilVBAExcelSpecialist

Related Posts Plugin for WordPress, Blogger...

Vitrine