Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default If ActiveCell has a comment then exit sub

On Monday, January 12, 2015 at 11:12:33 PM UTC-8, Claus Busch wrote:
Hi Howard,

Am Mon, 12 Jan 2015 17:13:24 -0800 (PST) schrieb L. Howard:

ElseIf myAE = "Edit" Then
MyComment = InputBox("Enter your comments", "Comments")
ActiveCell.Comment.Text Text:=MyComment


what if she wants to keep the existing text and add new text?


Regards
Claus B.
--



That was not mentioned.

I messed with it a bit and can get the OLD text to a variable but can't get it to precede the NEW text in the code.

It has to be something like this but this won't fly...

ElseIf myAE = "Edit" Then
oldCmt = ActiveCell.Comment.Text

MyComment = InputBox("Enter your Comment NEW text...", "Comments")
ActiveCell.Comment.Text Text:=oldCmt & " " & Text:=MyComment

Howard
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default If ActiveCell has a comment then exit sub

Hi Howard,

Am Tue, 13 Jan 2015 00:30:14 -0800 (PST) schrieb L. Howard:

I messed with it a bit and can get the OLD text to a variable but can't get it to precede the NEW text in the code.


have a look:
https://onedrive.live.com/?cid=9378A...121822A3%21326
for "Comments"

The suggestion is realised with a modeless userform.


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default If ActiveCell has a comment then exit sub

have a look:
https://onedrive.live.com/?cid=9378A...121822A3%21326
for "Comments"

The suggestion is realised with a modeless userform.


Regards
Claus B.


Thanks for the example. A good learning tool.

Howard
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default If ActiveCell has a comment then exit sub

Hi Howard,

Am Tue, 13 Jan 2015 04:02:10 -0800 (PST) schrieb L. Howard:

Thanks for the example. A good learning tool.


you are welcome. I am always glad to help.
Do you have the latest version with the label above the textbox?


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default If ActiveCell has a comment then exit sub

Do you have the latest version with the label above the textbox?



Yes, the Label that informs to use CTRL + Enter for new line?

I do have a couple questions...

The Private Sub cmdOK_Click() code has:
UserForm1.txtCom.Enabled = False

And Private Sub cmdCancel_Click() code has:
.Enabled = False

But neither button Click dismiss the UserForm from the sheet.

I have to use the Red X cancel to close the UserForm.

I'm unsure how to fix that if indeed it requires fixing.

Howard


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default If ActiveCell has a comment then exit sub

Hi Howard,

Am Tue, 13 Jan 2015 09:18:56 -0800 (PST) schrieb L. Howard:

But neither button Click dismiss the UserForm from the sheet.


I thought that the user wants to edit or add more than one comment.
Therefore I made the UserForm modeless and visible until it is closed
with the red X. But you can add a button to hide the UserForm


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 852
Default If ActiveCell has a comment then exit sub

On Tuesday, January 13, 2015 at 9:29:00 AM UTC-8, Claus Busch wrote:
Hi Howard,

Am Tue, 13 Jan 2015 09:18:56 -0800 (PST) schrieb L. Howard:

But neither button Click dismiss the UserForm from the sheet.


I thought that the user wants to edit or add more than one comment.
Therefore I made the UserForm modeless and visible until it is closed
with the red X. But you can add a button to hide the UserForm


Regards
Claus B.
--


Aa Ha! Now it works and makes sense to me.

Bring up the UserForm and Add, Edit or Delete any or all comments on the sheet.

I'll most likely put the Hide-When-Done button on it.

Also, my archive system is not as good as it should be, because I was trying to find a "Comment Making" solution from you having to do with a weekly assigning Desk times, or Room Reservations for a number of people. It too used a UserForm and I know I have it in my archive.

Thanks,
Howard

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default If ActiveCell has a comment then exit sub

I'd be inclined to go with a userform but it would help if you had some
basic understanding of the simple task of appending, prepending,
inserting, and replacing string values. As for your attempt here...

ElseIf myAE = "Edit" Then
oldCmt = ActiveCell.Comment.Text
MyComment = InputBox("Enter your comments", "Comments", oldCmt)
ActiveCell.Comment.Text Text:=MyComment

...where the existing comment text displays for the user to edit.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default If ActiveCell has a comment then exit sub

I'd be inclined to go with a userform but it would help if you had some
basic understanding of the simple task of appending, prepending,
inserting, and replacing string values. As for your attempt here...

ElseIf myAE = "Edit" Then
oldCmt = ActiveCell.Comment.Text
MyComment = InputBox("Enter your comments", "Comments", oldCmt)
ActiveCell.Comment.Text Text:=MyComment

...where the existing comment text displays for the user to edit.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


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
ActiveCell.Offset(i, 0) = Chr(ActiveCell.Row + 62) returns all A's Howard Excel Programming 5 December 25th 12 04:08 AM
Amend sub to re-hide comment when activecell change to another Max Excel Programming 4 January 4th 08 03:43 AM
Exit Field vs Exit Button...... roy_ware Excel Programming 2 October 10th 07 04:05 PM
If activecell.column = variable then activecell,offset (0,1) Battykoda via OfficeKB.com Excel Discussion (Misc queries) 1 October 2nd 07 08:05 PM
If a called sub exit, how to the caller exit right away? luvgreen[_4_] Excel Programming 4 February 24th 04 05:06 PM


All times are GMT +1. The time now is 09:28 AM.

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

About Us

"It's about Microsoft Excel"