Notifications
Clear all

Comentários excel

8 Posts
2 Usuários
0 Reactions
897 Visualizações
(@fer-mf)
Posts: 2
New Member
Topic starter
 

Fala galera, estou com uma duvida, já procurei em vários lugares mais não encontrei solução!!
Existe alguma forma de colocar uma formula dentro de um comentário no excel ?
Por exemplo, no comentário da celula A1 tem que aparecer o valor de A2+A3.

 
Postado : 03/03/2012 11:26 am
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Boa tarde!!

Até onde sei não..

Talvez ha um chance via VBA

Att.

 
Postado : 03/03/2012 2:34 pm
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

boa tarde!!
Veja algumas opções por VBA

Sub InsertComment()
    With Range("b3")
        If .HasFormula Then
            .Offset(2).AddComment Text:=.Formula
        End If
    End With
End Sub


Function getComment(incell) As String
' aceepts a cell as input and returns its comments (if any) back as a string
On Error Resume Next
getComment = incell.Comment.Text
End Function
 
Postado : 03/03/2012 2:58 pm
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Permitam-me... :arrow:

Uma opção:

 
Postado : 03/03/2012 3:26 pm
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Bom dia!!

Essa deve funcionar..

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim x
    x = Application.Sum(Range("A2:A3"))
   With Cells(1, 1)
    .ClearComments
    .AddComment.Text Text:=CStr(x)
End With
     
End Sub
 
Postado : 04/03/2012 4:36 am
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Uma outra orientação para aplicação na coluna F.

Private Sub Worksheet_Change(ByVal Target As Range)
'Por: José Arnaldo
Application.ScreenUpdating = False
On Error GoTo Fin
If Not Intersect(Target, Range("F1:F" & Rows.Count)) Is Nothing Then
'Se utilizar área além da coluna F alterar
If Target = Empty Or Intersect(Target, [F:F]) Is Nothing Then Exit Sub
    Dim qt As Integer
    qt = Sheets("Plan1").[F1].CurrentRegion.Rows.Count
[F:F].ClearComments
With Target
   .AddComment
   .Comment.Visible = True
   .Comment.Shape.Select True
   .Comment.Text Text:="Total = " & Application.WorksheetFunction.Sum(Plan1.Range("F1:F" & qt))
   .Select
End With
Exit Sub
Fin:
[F:F].ClearComments
End If
Application.ScreenUpdating = True
End Sub
 
Postado : 04/03/2012 7:20 am
(@fer-mf)
Posts: 2
New Member
Topic starter
 

Fala galera, valeu mesmo deu certo!!
Vocês são feras no assunto hehehehe!!
Obrigado

 
Postado : 04/03/2012 10:06 am
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Boa tarde fer.mf

Vc pode agradecer as pessoas que te ajudaram clicando na mãozinha.

Veja tópico com explicação:

viewtopic.php?f=9&t=2394

Abraço.

 
Postado : 04/03/2012 10:32 am