ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Comments (https://www.excelbanter.com/excel-programming/277732-comments.html)

Christopher Weaver

Comments
 
I would like the user to be taken to a new comment, or the existing one, of
the currently selected cell. I can get a new comment inserted

With Selection
.AddComment
.Comment.Visible = False
.Comment.Text Text:=""

End With


but I can't get the cursor to end up inside the comment, awaiting the user's
input.

Any ideas?

Thanks.



Debra Dalgleish[_2_]

Comments
 
There's some sample code for inserting or editing comments he

http://www.contextures.com/xlcomments03.html#Plain

Christopher Weaver wrote:
I would like the user to be taken to a new comment, or the existing one, of
the currently selected cell. I can get a new comment inserted

With Selection
.AddComment
.Comment.Visible = False
.Comment.Text Text:=""

End With


but I can't get the cursor to end up inside the comment, awaiting the user's
input.



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


Christopher Weaver

Comments
 
Thank you, that's exactly what I was looking for.

BTW, what does "%ie~" refer to in the SendKeys?



"Debra Dalgleish" wrote in message
...
There's some sample code for inserting or editing comments he

http://www.contextures.com/xlcomments03.html#Plain

Christopher Weaver wrote:
I would like the user to be taken to a new comment, or the existing one,

of
the currently selected cell. I can get a new comment inserted

With Selection
.AddComment
.Comment.Visible = False
.Comment.Text Text:=""

End With


but I can't get the cursor to end up inside the comment, awaiting the

user's
input.



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html




Debra Dalgleish[_2_]

Comments
 
The % represents the Alt key, so Alt+i opens the Insert menu
On the Insert menu, the e in Edit Comment is underlined, so that command
is selected when the e is sent.

Christopher Weaver wrote:
Thank you, that's exactly what I was looking for.

BTW, what does "%ie~" refer to in the SendKeys?



"Debra Dalgleish" wrote in message
...

There's some sample code for inserting or editing comments he

http://www.contextures.com/xlcomments03.html#Plain

Christopher Weaver wrote:

I would like the user to be taken to a new comment, or the existing one,


of

the currently selected cell. I can get a new comment inserted

With Selection
.AddComment
.Comment.Visible = False
.Comment.Text Text:=""

End With


but I can't get the cursor to end up inside the comment, awaiting the


user's

input.



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html






--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


Dana DeLouis[_5_]

Comments
 
Would an InputBox work for you?
(This does not use a Set variable)

Sub Demo()
With ActiveCell
If .Comment Is Nothing Then
.AddComment InputBox("Enter text for Comment")
.Comment.Shape.TextFrame.AutoSize = True
End If
End With
End Sub

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Christopher Weaver" wrote in message
...
Thank you, that's exactly what I was looking for.

BTW, what does "%ie~" refer to in the SendKeys?



"Debra Dalgleish" wrote in message
...
There's some sample code for inserting or editing comments he

http://www.contextures.com/xlcomments03.html#Plain

Christopher Weaver wrote:
I would like the user to be taken to a new comment, or the existing

one,
of
the currently selected cell. I can get a new comment inserted

With Selection
.AddComment
.Comment.Visible = False
.Comment.Text Text:=""

End With


but I can't get the cursor to end up inside the comment, awaiting the

user's
input.



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html






Christopher Weaver

Comments
 
This is great! Got a dialog box with a larger input window?


"Dana DeLouis" wrote in message
...
Would an InputBox work for you?
(This does not use a Set variable)

Sub Demo()
With ActiveCell
If .Comment Is Nothing Then
.AddComment InputBox("Enter text for Comment")
.Comment.Shape.TextFrame.AutoSize = True
End If
End With
End Sub

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Christopher Weaver" wrote in message
...
Thank you, that's exactly what I was looking for.

BTW, what does "%ie~" refer to in the SendKeys?



"Debra Dalgleish" wrote in message
...
There's some sample code for inserting or editing comments he

http://www.contextures.com/xlcomments03.html#Plain

Christopher Weaver wrote:
I would like the user to be taken to a new comment, or the existing

one,
of
the currently selected cell. I can get a new comment inserted

With Selection
.AddComment
.Comment.Visible = False
.Comment.Text Text:=""

End With


but I can't get the cursor to end up inside the comment, awaiting

the
user's
input.


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html








Christopher Weaver

Comments
 
Thank you again. This is very valuable information. As you can see, I'm
really new at this. I'm finding the help text not well organized for my
purposes. I hope you all will tolerate my questions.


"Debra Dalgleish" wrote in message
...
The % represents the Alt key, so Alt+i opens the Insert menu
On the Insert menu, the e in Edit Comment is underlined, so that command
is selected when the e is sent.

Christopher Weaver wrote:
Thank you, that's exactly what I was looking for.

BTW, what does "%ie~" refer to in the SendKeys?



"Debra Dalgleish" wrote in message
...

There's some sample code for inserting or editing comments he

http://www.contextures.com/xlcomments03.html#Plain

Christopher Weaver wrote:

I would like the user to be taken to a new comment, or the existing

one,

of

the currently selected cell. I can get a new comment inserted

With Selection
.AddComment
.Comment.Visible = False
.Comment.Text Text:=""

End With


but I can't get the cursor to end up inside the comment, awaiting the

user's

input.


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html






--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html




Christopher Weaver

Comments
 
OK, this is the kind of thing that makes me nuts! It worked, really it did,
and now it doesn't. The part that's failing, oddly, is the part that I
didn't understand in the first place: SendKeys "%ie~". The comment is
created but never does the edit comment happen.

Any ideas on this?


"Debra Dalgleish" wrote in message
...
The % represents the Alt key, so Alt+i opens the Insert menu
On the Insert menu, the e in Edit Comment is underlined, so that command
is selected when the e is sent.

Christopher Weaver wrote:
Thank you, that's exactly what I was looking for.

BTW, what does "%ie~" refer to in the SendKeys?



"Debra Dalgleish" wrote in message
...

There's some sample code for inserting or editing comments he

http://www.contextures.com/xlcomments03.html#Plain

Christopher Weaver wrote:

I would like the user to be taken to a new comment, or the existing

one,

of

the currently selected cell. I can get a new comment inserted

With Selection
.AddComment
.Comment.Visible = False
.Comment.Text Text:=""

End With


but I can't get the cursor to end up inside the comment, awaiting the

user's

input.


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html






--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html




Christopher Weaver

Comments
 
A correction to my most recent post within this branch of this thread:

This code works fine when invoke through Alt-F8, etc. It fails when I
invoke it with a CTRL-key shortcut key that I defined in the Options dialog
box within the macros dialog box.


"Debra Dalgleish" wrote in message
...
The % represents the Alt key, so Alt+i opens the Insert menu
On the Insert menu, the e in Edit Comment is underlined, so that command
is selected when the e is sent.

Christopher Weaver wrote:
Thank you, that's exactly what I was looking for.

BTW, what does "%ie~" refer to in the SendKeys?



"Debra Dalgleish" wrote in message
...

There's some sample code for inserting or editing comments he

http://www.contextures.com/xlcomments03.html#Plain

Christopher Weaver wrote:

I would like the user to be taken to a new comment, or the existing

one,

of

the currently selected cell. I can get a new comment inserted

With Selection
.AddComment
.Comment.Visible = False
.Comment.Text Text:=""

End With


but I can't get the cursor to end up inside the comment, awaiting the

user's

input.


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html






--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html





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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com