Home Excel - Downloads / Areas Restritas Excel VBA - Comentarios

Excel VBA - Comentarios

  • - Acesso Livre
  • Documentos

    Ordenar por : Nome | Data | Acessos [ Descendente ]

    vba comentario formata fonte cor tamanho e insere dados vba comentario formata fonte cor tamanho e insere dados

    popular!
    Adicionado em: 19/11/2010
    Modificado em: 19/11/2010
    Tamanho: Vazio
    Downloads: 540

    SaberExcel - o site das macros
    Essa macro do Aplicativo Microsoft Excel VBA, formata o todos os comentários existentes
    no livro, isto é em todas as folhas de planilhas.
    1º.) - Formata o tamanho da fonte a ser empregada
    2º.) - Determina o nome da fonte a ser empregada
    3º.) - Formata a cor da fonte a ser empregada
    4º.) - Mostra o email desejado em todos os comentários.
    5º.) - Insere dados na célula(D17) e carrega o comentário com esses dados.
    6º.) - Insere formato da fonte em negrito.
    7º.) - Insere formato da da data e hora atual (Agora()).

    Sub vba_comentario_formatando()
    ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:=False
    Dim Wsh As Worksheet, vMeuComentario As Comment

    For Each Wsh In Worksheets
    For Each vMeuComentario In Wsh.Comments
    vMeuComentario.Shape.OLEFormat.Object.AutoSize = True

    With vMeuComentario.Shape.OLEFormat.Object.Font
    Range("D17").Comment.Text Text:= _
    "Excel VBA Estudos®" & Now() & Chr(10) & " * Digite um valor menor que Célula E18! - << [email protected] >>"
    .Name = "Courrier New"
    .Size = 10
    .ColorIndex = 12
    .Bold = True
    End With

    vMeuComentario.Shape.OLEFormat.Object.ShapeRange.Fill.ForeColor.SchemeColor = 27
    Next vMeuComentario
    Next Wsh
    ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:=True
    End Sub


    Aprenda Microsoft Excel VBA(Visual Basic Application)


    vba comentario formata comentarios em todas plans cor azul vba comentario formata comentarios em todas plans cor azul

    popular!
    Adicionado em: 19/11/2010
    Modificado em: 19/11/2010
    Tamanho: Vazio
    Downloads: 495


    Saberexcel - o site das macros microsfot excel vba
    Macro do Aplicativo Microsoft Excel VBA, formata o comentário com fundo Azul em todas as folhas de planilhas (For each)

    Sub Formatar_Comentario()
    Dim Wks As Worksheet, vComentario As Comment

    For Each Wks In Worksheets
    For Each vComentario In Wks.Comments
    vComentario.Shape.OLEFormat.Object.AutoSize = True

    With vComentario.Shape.OLEFormat.Object.Font
    .Name = "Verdana"
    .Size = 10
    .ColorIndex = 9
    .Bold = True
    End With

    vComentario.Shape.OLEFormat.Object.ShapeRange.Fill.ForeColor.SchemeColor = 35
    Next vComentario
    Next Wks
    End Sub



    Aprenda Microsoft Excel VBA ((Saberexcel))


    vba comentario insere comentario fonte vba comentario insere comentario fonte

    popular!
    Adicionado em: 19/11/2010
    Modificado em: 19/11/2010
    Tamanho: Vazio
    Downloads: 565

    Saberexcel - o site das macros
    Inserir um comentário com texto formatação fonte e tamanho predefinido

    Esta macro do aplicativo Microsoft Excel VBA, insere um comentario personalizado, com formatação, e texto pre-determinado:
    Determinar a fonte da formatação
    Determinar a cor da fonte
    Inserir (autofit) para ajustar ajuste de tamanho do comentário ao texto

    Sub inserir_comentario()
    Dim x As Range
    Set x = ActiveCell

    x.ClearComments
    x.AddComment.Text _
    Text:="Aprender excel vba é fundamental (Saberexcel)"
    x.Comment.Visible = True
    x.Comment.Shape.Select True

    With Selection.Font
    .Name = "Tahoma"
    .FontStyle = "Regular"
    .Size = 12
    End With

    With Selection.Interior
    x.Interior.ThemeColor = xlThemeColorAccent3 '2007 se testar outra versão, desabilite a linha
    End With

    With Selection
    .Placement = xlFreeFloating
    .PrintObject = False
    .Locked = True
    .LockedText = True
    .AutoSize = True
    End With


    Application.DisplayCommentIndicator _
    = xlCommentIndicatorOnly
    End Sub


    Aprenda Microsoft Excel VBA (SaberExcel)



    vba comentario insere shapes numerando os comentarios cores vba comentario insere shapes numerando os comentarios cores

    popular!
    Adicionado em: 19/11/2010
    Modificado em: 19/11/2010
    Tamanho: Vazio
    Downloads: 485

    Saberexcel - o site das macros
    Macros do Aplicativo Microsoft Excel VBA, insere shapes númerados nos comentários.

    Sub inserir_shapes_numerados()

    Dim Wsh As Worksheet
    Dim cmt As Comment
    Dim lCmt As Long
    Dim rngCmt As Range
    Dim shpCmt As Shape
    Dim shpW As Double 'shape width
    Dim shpH As Double 'shape height

    Set Wsh = ActiveSheet
    shpW = 8
    shpH = 6
    lCmt = 1

    For Each cmt In Wsh.Comments
    Set rngCmt = cmt.Parent
    With rngCmt
    Set shpCmt = Wsh.Shapes.AddShape(msoShapeRectangle, _
    rngCmt.Offset(0, 1).Left - shpW, .Top, shpW, shpH)
    End With
    With shpCmt
    With .Fill
    .ForeColor.SchemeColor = 2 'white
    .Visible = msoTrue
    .Solid
    End With
    With .Line
    .Visible = msoTrue
    .ForeColor.SchemeColor = 64 'automatic
    .Weight = 0.25
    End With
    With .TextFrame
    .Characters.Text = lCmt
    .Characters.Font.Size = 4
    .MarginLeft = 0#
    .MarginRight = 0#
    .MarginTop = 0#
    .MarginBottom = 0#
    .HorizontalAlignment = xlCenter
    End With
    .Top = .Top + 0.001
    End With
    lCmt = lCmt + 1
    Next cmt

    End Sub

    Esta macro remove os indicadores(shapes) inseridos nos comentários
    Sub Remove_indicador_shapes()

    Dim Wsh As Worksheet
    Dim shp As Shape

    Set Wsh = ActiveSheet

    For Each shp In Wsh.Shapes
    If Not shp.TopLeftCell.Comment Is Nothing Then
    If shp.AutoShapeType = _
    msoShapeRectangle Then
    shp.Delete
    End If
    End If
    Next shp

    End Sub

    Esta macro relaciona os comentários em uma folha de planilha separada, numero, nome, valor, e endereço do comentário
    Sub Relacionar_comentarios()
    Application.ScreenUpdating = False

    Dim commrange As Range
    Dim cmt As Comment
    Dim Atual_Plan As Worksheet
    Dim nova_plan As Worksheet
    Dim i As Long

    Set Atual_Plan = ActiveSheet

    On Error Resume Next
    Set commrange = Atual_Plan.Cells _
    .SpecialCells(xlCellTypeComments)
    On Error GoTo 0

    If commrange Is Nothing Then
    MsgBox "nao foi encontrado comentários"
    Exit Sub
    End If

    Set nova_plan = Worksheets.Add

    nova_plan.Range("A1:D1").Value = _
    Array("Numero", "Nome", "Valor", "Comentário")

    i = 1
    For Each cmt In Atual_Plan.Comments
    With nova_plan
    i = i + 1
    On Error Resume Next
    .Cells(i, 1).Value = i - 1
    .Cells(i, 2).Value = cmt.Parent.Name.Name
    .Cells(i, 3).Value = cmt.Parent.Value
    .Cells(i, 4).Value = cmt.Parent.Address
    .Cells(i, 5).Value = Replace(cmt.Text, Chr(10), " ")
    End With
    Next cmt

    nova_plan.Cells.WrapText = False
    nova_plan.Columns.AutoFit

    Application.ScreenUpdating = True

    End Sub

     

    Aprenda Microsoft Excel VBA (Saberexcel)



    vba comentario anota acessos dados e data no comentario vba comentario anota acessos dados e data no comentario

    popular!
    Adicionado em: 19/11/2010
    Modificado em: 19/11/2010
    Tamanho: Vazio
    Downloads: 734

    Saberexcel - site das macros
    Anota no comentário as vezes que a célula foi acessada e os dados modificados

    Essa macro do Aplicativo Microsoft Excel VBA, anota todas vezes que acessar a célula(E5) e fazer alguma modificação, mostrando a palavra inserida, hora e data do acesso. Observe que usei o Evento Worksheet_Change (No módulo de código da planilha)

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column <> 5 Then Exit Sub
    If Target.Row <> 5 Then Exit Sub

    Dim ccc As String
    ccc = Format(Date + Time, "mm/dd/yy hh:mm") _
    & " " & Target.Value ' -- Application.UserName
    If Target.Comment Is Nothing Then
    Target.AddComment.Text ccc
    Else

    Target.Comment.Text (Target.Comment.Text & Chr(10) & ccc)
    End If

    Target.Comment.Shape.TextFrame.AutoSize = True
    End Sub

    Aprenda Microsoft Excel VBA (Saberexcel)

    Página 2 de 6

    PROMOÇÃO DIDÁTICOS SABEREXCEL



    Adquira já o Acesso Imediato
    à Area de Membros

    Compra Grantida --- Entrega Imediata

    Aprenda Excel VBA com Simplicidade de 
    códigos e Eficácia, Escrevendo Menos e
    Fazendo Mais.

    '-------------------------------------'
    Entrega Imediata:
    +  500 Video Aulas MS Excel VBA
    +  35.000 Planilhas Excel e VBA
    +  Coleção 25.000 Macros MS Excel VBA
    +  141 Planilhas Instruções Loops
    +  341 Planilhas WorksheetFunctions(VBA)
    +    04 Módulos Como Fazer Excel VBA
    +  Curso Completo MS Excel VBA
    +  Planilhas Inteligentes


    Pesquisa Google SaberExcel

    Publicidade Google

    <script type="text/javascript"><!--

    google_ad_client = "ca-pub-2317234650173689";

    /* retangulo 336 x 280 */

    google_ad_slot = "0315083363";

    google_ad_width = 336;

    google_ad_height = 280;

    //-->

    </script>

    <script type="text/javascript"

    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

    </script>

    Publicidade

    RSFirewallProtected


    Google Associados

    Depoimentos

    Adicione Saberexcel Favoritos

     
     

    Aprenda tudo sobre o Aplicativo Microsoft Excel VBA

    Aprenda tudo sobre o Aplicativo Microsoft Excel VBA(Visual Basic Application), sozinho, com baixo custo, praticando com os produtos didáticos Saberexcel,


       Sobre as WorksheetFunctions Funções de Planilhas que retornam valores do VBA