Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Still Need Help Repositioning Comments

I'm trying to position Comments above the cell they relate to. When running
this code, (trying different numbers for Top, Left), the comment only appears
repositioned when I right click the cell and click "Edit Comment", i.e. in
edit mode. Thus, the code isn't working. I need to resolve this today, if
possible. Help, please.

Sub RePosComments()
Dim myCell As Range
Dim myRng As Range
Sheets("Detail").Activate
Range("dAllHeaders").Select

Set myRng = Selection

For Each myCell In myRng.Cells
If Not (myCell.Comment Is Nothing) Then
With myCell.Comment

.Shape.Top = .Parent.Offset(0, 1).Top + 5
.Shape.Left = .Parent.Offset(0, 1).Left - 5
End With
End If
Next
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Still Need Help Repositioning Comments

Unfortunately there is no way to change where a comment appears when we
hover the mouse over a cell.

--
Jim
"Perico" wrote in message
...
I'm trying to position Comments above the cell they relate to. When
running
this code, (trying different numbers for Top, Left), the comment only
appears
repositioned when I right click the cell and click "Edit Comment", i.e. in
edit mode. Thus, the code isn't working. I need to resolve this today,
if
possible. Help, please.

Sub RePosComments()
Dim myCell As Range
Dim myRng As Range
Sheets("Detail").Activate
Range("dAllHeaders").Select

Set myRng = Selection

For Each myCell In myRng.Cells
If Not (myCell.Comment Is Nothing) Then
With myCell.Comment

.Shape.Top = .Parent.Offset(0, 1).Top + 5
.Shape.Left = .Parent.Offset(0, 1).Left - 5
End With
End If
Next
End Sub




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Still Need Help Repositioning Comments

Actually, that's true, you can move the comments. The following code did
work using these numbers and adding a offset to the Top syntax:


Sub ResetComments()
Dim cmt As Comment
For Each cmt In ActiveSheet.Comments
cmt.Shape.Top = cmt.Parent.Offset(0, 0).Top - 60
cmt.Shape.Left = _
cmt.Parent.Offset(0, 0).Left + 5
Next
End Sub


"Jim Rech" wrote:

Unfortunately there is no way to change where a comment appears when we
hover the mouse over a cell.

--
Jim
"Perico" wrote in message
...
I'm trying to position Comments above the cell they relate to. When
running
this code, (trying different numbers for Top, Left), the comment only
appears
repositioned when I right click the cell and click "Edit Comment", i.e. in
edit mode. Thus, the code isn't working. I need to resolve this today,
if
possible. Help, please.

Sub RePosComments()
Dim myCell As Range
Dim myRng As Range
Sheets("Detail").Activate
Range("dAllHeaders").Select

Set myRng = Selection

For Each myCell In myRng.Cells
If Not (myCell.Comment Is Nothing) Then
With myCell.Comment

.Shape.Top = .Parent.Offset(0, 1).Top + 5
.Shape.Left = .Parent.Offset(0, 1).Left - 5
End With
End If
Next
End Sub





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Still Need Help Repositioning Comments

I should have added, that the comment must be visible to do this. When
hidden, it apparently snaps back to a default position over which we have no
control.

"Perico" wrote:

Actually, that's true, you can move the comments. The following code did
work using these numbers and adding a offset to the Top syntax:


Sub ResetComments()
Dim cmt As Comment
For Each cmt In ActiveSheet.Comments
cmt.Shape.Top = cmt.Parent.Offset(0, 0).Top - 60
cmt.Shape.Left = _
cmt.Parent.Offset(0, 0).Left + 5
Next
End Sub


"Jim Rech" wrote:

Unfortunately there is no way to change where a comment appears when we
hover the mouse over a cell.

--
Jim
"Perico" wrote in message
...
I'm trying to position Comments above the cell they relate to. When
running
this code, (trying different numbers for Top, Left), the comment only
appears
repositioned when I right click the cell and click "Edit Comment", i.e. in
edit mode. Thus, the code isn't working. I need to resolve this today,
if
possible. Help, please.

Sub RePosComments()
Dim myCell As Range
Dim myRng As Range
Sheets("Detail").Activate
Range("dAllHeaders").Select

Set myRng = Selection

For Each myCell In myRng.Cells
If Not (myCell.Comment Is Nothing) Then
With myCell.Comment

.Shape.Top = .Parent.Offset(0, 1).Top + 5
.Shape.Left = .Parent.Offset(0, 1).Left - 5
End With
End If
Next
End Sub





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Still Need Help Repositioning Comments

Perico,
Yes, if you the set ToolsOptionsViewComments to Comments & Indicator, you
can position the comment, but it is always displayed.
If you only want to see the comment when the mouse is over the cell, the you
are stuck with the default positioning.

NickHK

"Perico" wrote in message
...
I should have added, that the comment must be visible to do this. When
hidden, it apparently snaps back to a default position over which we have

no
control.

"Perico" wrote:

Actually, that's true, you can move the comments. The following code

did
work using these numbers and adding a offset to the Top syntax:


Sub ResetComments()
Dim cmt As Comment
For Each cmt In ActiveSheet.Comments
cmt.Shape.Top = cmt.Parent.Offset(0, 0).Top - 60
cmt.Shape.Left = _
cmt.Parent.Offset(0, 0).Left + 5
Next
End Sub


"Jim Rech" wrote:

Unfortunately there is no way to change where a comment appears when

we
hover the mouse over a cell.

--
Jim
"Perico" wrote in message
...
I'm trying to position Comments above the cell they relate to. When
running
this code, (trying different numbers for Top, Left), the comment

only
appears
repositioned when I right click the cell and click "Edit Comment",

i.e. in
edit mode. Thus, the code isn't working. I need to resolve this

today,
if
possible. Help, please.

Sub RePosComments()
Dim myCell As Range
Dim myRng As Range
Sheets("Detail").Activate
Range("dAllHeaders").Select

Set myRng = Selection

For Each myCell In myRng.Cells
If Not (myCell.Comment Is Nothing) Then
With myCell.Comment

.Shape.Top = .Parent.Offset(0, 1).Top + 5
.Shape.Left = .Parent.Offset(0, 1).Left - 5
End With
End If
Next
End Sub







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Repositioning cursor Maria Excel Programming 1 December 29th 05 06:01 PM
Repositioning a cell based on its value Paul987 Excel Discussion (Misc queries) 4 October 27th 05 08:33 PM
Repositioning a cell based on its value Paul987 Excel Worksheet Functions 1 October 27th 05 04:29 PM
Repositioning the tabs Mr Mike Excel Worksheet Functions 1 July 8th 05 09:20 PM
repositioning aging categories in a pivot when present Hans Weustink Excel Programming 0 August 19th 04 11:23 AM


All times are GMT +1. The time now is 03:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"