Adicionado em: | 19/11/2010 |
Modificado em: | 19/11/2010 |
Tamanho: | Vazio |
Downloads: | 513 |
Saberexcel - o site das macros
Esta macro do aplicativo Microsoft Excel VBA, formatam o tamanho da fonte
dos comentarios em uma determinada folha de planilha
Sub Tamanho_fonte_comentario()
On Error Resume Next
Dim sbComentario As Comment
For Each sbComentario In ActiveSheet.Comments
sbComentario.Shape.TextFrame.Characters.Font.Size = 9
Next
End Sub
'Esta macro também formata o tamanho da fonte dos comentarios, porém, age
'como uma auxiliar para testes.
Sub Tamanho_fonte_comentario()
On Error Resume Next
Dim sbComentario As Comment
For Each sbComentario In ActiveSheet.Comments
sbComentario.Shape.TextFrame.Characters.Font.Size = 18
Next
End Sub
Aprenda Microsoft Excel VBA com qualidade Saberexcel
sozinho em casa, com baixo custo
Compre com segurança numa das maiores lojas do pais, tem de tudo a bons preços.
Adicionado em: | 19/11/2010 |
Modificado em: | 19/11/2010 |
Tamanho: | Vazio |
Downloads: | 500 |
Macros do Aplicativo Microsoft Excel VBA - reposiciona um comentario a partir da célula selecionada.
observem que na entrada da macro selecionei tres células referente a comentarios inseridos.
Sub Reposicionamento_comentario_selecionados()
On Error Resume Next
Range("G6,K14,O22").Select
Dim Sb As Range
Dim vMinhaCelula As Range
Set vMinhaCelula = Selection
For Each Sb In vMinhaCelula.Cells
With Sb.Comment
.Shape.Top = .Parent.Top + 5
.Shape.Left = .Parent.Offset(0, 1).Left + 5
End With
Next
vMinhaCelula.Select
[D1].Select
End Sub
Sub Reposicionamento_comentario_selecionados_II()
On Error Resume Next
Range("G6,K14,O22").Select
Dim Sb As Range
Dim vMinhaCelula As Range
Set vMinhaCelula = Selection
For Each Sb In vMinhaCelula.Cells
With Sb.Comment
.Shape.Top = .Parent.Top + 50
.Shape.Left = .Parent.Offset(0, 1).Left + 50
End With
Next
vMinhaCelula.Select
[D1].Select
End Sub
Aprenda Microsoft Excel VBA (Visual Basic Application) com qualidade Saberexcel
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))
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
Adicionado em: | 19/11/2010 |
Modificado em: | 19/11/2010 |
Tamanho: | Vazio |
Downloads: | 471 |
Saberexcel - dicas de macros microsoft excel vba
Essa macro do aplicativo Microsoft Excel VBA adiciona um um texto a um comentario a partir da célula ativa.
Sub adicionando_comentario_com_texto()
On Error Resume Next
ActiveCell.AddComment
ActiveCell.Comment.Text Text:=ActiveCell.Text
End Sub
'Macro auxiliar para os testes dos alunos desenvolvedores
Sub deleta_todos_teste()
Dim resposta As String
resposta = MsgBox("Deseja deletar todos os comentarios para teste?", vbYesNo + vbCritical, _
"Saberexcel - Site das Macros")
If resposta = 6 Then '=sim
For Each sb In ActiveSheet.Comments
sb.Delete
Next
End If
End Sub
Adquira já o Acesso Imediato
à Area de Membros
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
<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>
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