PC Review


Reply
 
 
kirkm
Guest
Posts: n/a
 
      26th Mar 2009

I'm really hoping someone can assist - I've spent ages
trying to sort what should be an easy task. Even asked a couple
of questions here, but never got anywhere.

The problem is positioning a Comment. Here's what I have (the 2
remmed lines show some of the methods I've tried).

--

Sub Showc(ByVal r)

Dim rng As Range
Dim cTop
Set rng = ActiveWindow.VisibleRange
cTop = rng.Top + rng.Height / 2
With Worksheets("Sheet1").Range(r)
If Not .Comment Is Nothing Then
With .Comment
With .Shape
.Top = cTop - 215
'.Left = Range("M11").Left + 47
'.Left = Form1.Left + Form1.Width + 90
.Left = 739
Application.StatusBar = .Left
End With
.Visible = True
End With
End If
End With
Set rng = Nothing

End Sub

--
The Top postion is perfect, but the Left varies. Even using constant
739 (as a test) the status bar shows the actual left is 739.5, or
sometimes 738.75. The higher number places the Comment closer to
screen left. Ideally I'd like it to sit beside Form1 on the right hand
side, intending this to allow for different screen resolutions
as the Form would always be centered.

Does anyone know why it's changing, and if there's any way to
use the Forms position to calculate where Comment left should go?

Thanks - Kirk
 
Reply With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      26th Mar 2009
..Left = Application.Width - ((Application.Width - UserForm1.Width) / 2)

If this post helps click Yes
---------------
Jacob Skaria


"kirkm" wrote:

>
> I'm really hoping someone can assist - I've spent ages
> trying to sort what should be an easy task. Even asked a couple
> of questions here, but never got anywhere.
>
> The problem is positioning a Comment. Here's what I have (the 2
> remmed lines show some of the methods I've tried).
>
> --
>
> Sub Showc(ByVal r)
>
> Dim rng As Range
> Dim cTop
> Set rng = ActiveWindow.VisibleRange
> cTop = rng.Top + rng.Height / 2
> With Worksheets("Sheet1").Range(r)
> If Not .Comment Is Nothing Then
> With .Comment
> With .Shape
> .Top = cTop - 215
> '.Left = Range("M11").Left + 47
> '.Left = Form1.Left + Form1.Width + 90
> .Left = 739
> Application.StatusBar = .Left
> End With
> .Visible = True
> End With
> End If
> End With
> Set rng = Nothing
>
> End Sub
>
> --
> The Top postion is perfect, but the Left varies. Even using constant
> 739 (as a test) the status bar shows the actual left is 739.5, or
> sometimes 738.75. The higher number places the Comment closer to
> screen left. Ideally I'd like it to sit beside Form1 on the right hand
> side, intending this to allow for different screen resolutions
> as the Form would always be centered.
>
> Does anyone know why it's changing, and if there's any way to
> use the Forms position to calculate where Comment left should go?
>
> Thanks - Kirk
>

 
Reply With Quote
 
kirkm
Guest
Posts: n/a
 
      26th Mar 2009
On Wed, 25 Mar 2009 21:38:00 -0700, Jacob Skaria
<(E-Mail Removed)> wrote:

>.Left = Application.Width - ((Application.Width - UserForm1.Width) / 2)


Thanks Jacob.

Can you explain this -

With .Shape

tmp = 89 + (Application.Width -
((Application.Width - frmSerial.Width) / 2))
.Left = tmp
Application.StatusBar = .Left & " " & tmp
End With

What shows in the status bar us

739.5 738.875

Proving that the value .Left is given, isn't the resultant value.
(So no wonder my Comment won't stay put !)

Isn't this a bit odd - Excel not doing what it's told??!!
Be nice to know why.

Cheers - Kirk
 
Reply With Quote
 
kirkm
Guest
Posts: n/a
 
      26th Mar 2009
Actually I think I have found why.

The line numbers - as they pass from 999 to 1000
or 9999 to 10000 the comment is put that far further to the right.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel 2000 how to format the comments font all comments Delquestion Microsoft Excel Misc 1 8th Oct 2009 02:19 PM
Merge Comments / Wrap comments / Concatonate Comments Gary Microsoft Access Queries 4 15th Apr 2009 03:46 PM
Comments-Format all Comments-Prior to making Harry's GMail World Microsoft Excel Discussion 2 19th Aug 2007 12:24 AM
in excel useing comments how do you add clip art to comments? =?Utf-8?B?ZGhvdXNl?= Microsoft Excel New Users 2 18th Jul 2007 08:14 AM
Comments record length cannot exceed 4000 in Comments of BCM, Outlook 2003 Chris Street Microsoft Outlook Discussion 1 20th Apr 2004 03:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:41 PM.