MrExcel Message Board

Go Back   MrExcel Message Board > Question Forums > Excel Questions

Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only.

Reply
 
Thread Tools Display Modes
Old Mar 27th, 2002, 05:29 PM   #1
chuck
New Member
 
Join Date: Mar 2002
Posts: 5
Default

I've seen various posts on extracting comments to cells. I need the other way around.

Col A is filled with part numbers.
Col B has the corresponding descriptions.

I'd like to take the descriptions in B
and turn them into comments for A.

It is a lot easier create comment text in a cell than in the comment box itself.

Ideas? Macros? Flames?
Thx, chuck
chuck is offline   Reply With Quote
Old Mar 27th, 2002, 05:33 PM   #2
Anne Troy
MrExcel MVP
 
Anne Troy's Avatar
 
Join Date: Feb 2002
Location: Allentown, PA
Posts: 2,510
Default

Flame: I can't figure out why in the world you would want to do that. Perhaps there's something you're trying to accomplish that would be more easily accomplished using Excel's features?


__________________
~Anne Troy
Anne Troy is offline   Reply With Quote
Old Mar 27th, 2002, 05:52 PM   #3
chuck
New Member
 
Join Date: Mar 2002
Posts: 5
Default

The descriptions in Col B can be fairly lengthy and I didn't want them cluttering up the sheet. I had planned on hiding Col B once the descriptions when into the comment.

Your reply made me think about it a bit more (which was probably the purpose). I suppose I could move the descriptions to another sheet in the workbook and turn the item numbers in Col A into Hyperlinks.

If you had a different Excel feature in mind, I'm open to ideas.

chuck
chuck is offline   Reply With Quote
Old Mar 27th, 2002, 07:51 PM   #4
Ivan F Moala
MrExcel MVP
 
Ivan F Moala's Avatar
 
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
Default

Quote:
On 2002-03-27 16:52, chuck wrote:
The descriptions in Col B can be fairly lengthy and I didn't want them cluttering up the sheet. I had planned on hiding Col B once the descriptions when into the comment.

Your reply made me think about it a bit more (which was probably the purpose). I suppose I could move the descriptions to another sheet in the workbook and turn the item numbers in Col A into Hyperlinks.

If you had a different Excel feature in mind, I'm open to ideas.

chuck
Hi Chuck
You could try this code;
Assumes
1)Part numbers Start A1
2)Discrp in Start B1
3)No blanks in your part number column

What it does:
1) gets column A part range
2) loops through this and deletes any comment
then adds the comment from column B
3) deletes Discrp in column B

Suggest you make a copy of these discriptions
so that if you need to change them just amend
the discp...paste and run macro again.

Amend as required.


Sub InsertComm()
Dim RgPartnumb As Range
Dim NRg As Range

Set RgPartnumb = Range(Range("A1"), Range("A1").End(xlDown))
On Error Resume Next
For Each NRg In RgPartnumb
With NRg
.Comment.Delete
.AddComment Text:=NRg.Offset(0, 1).Text
.Offset(0, 1).ClearContents
End With
Next

End Sub


HTH

Ivan
Ivan F Moala is offline   Reply With Quote
Old Mar 27th, 2002, 09:13 PM   #5
chuck
New Member
 
Join Date: Mar 2002
Posts: 5
Default

Ivan,
Thank you. It works perfectly.
Just what I needed.
Chuck
chuck is offline   Reply With Quote
Old Feb 26th, 2007, 05:07 AM   #6
nehpets12
Board Regular
 
Join Date: Feb 2002
Posts: 422
Default

Using This Macro How Do I resize the comment box

Selection.ShapeRange.ScaleWidth 1.82, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 2.51, msoFalse, msoScaleFromTopLeft
nehpets12 is offline   Reply With Quote
Old Jun 21st, 2007, 06:20 AM   #7
Thebatfink
Board Regular
 
Join Date: Apr 2007
Posts: 356
Default

Sorry to resurect such an old post but its exactly what I am trying to do. I want to put the result of a formula in a cell into a cell column.

The cells I want into comments are AH7:AH46, and I would like them in comments on cells E7:E46.

How would I modify the code to put in specific ranges?

Cheers!
Thebatfink is offline   Reply With Quote
Old Jun 21st, 2007, 09:58 AM   #8
Thebatfink
Board Regular
 
Join Date: Apr 2007
Posts: 356
Default

I've gotten it to work with the following code

Quote:

Sub InsertComm()
Dim RgPartnumb As Range
Dim NRg As Range

Set RgPartnumb = Range("E7:E46")
On Error Resume Next
For Each NRg In RgPartnumb
With NRg
.Comment.Delete
.AddComment Text:=NRg.Offset(0, 29).Text
End With
Next

End Sub
Now, this works pretty much as intended, however, how do I make it automatically update the comment whenever the value in column AH is changed?

Also I would like to change the size of the comment too, I have tried this code and whilst is does not give any errors when I jog through it, it doesnt seem to alter the size of the comment box?

Quote:

Sub InsertComm()
Dim RgPartnumb As Range
Dim NRg As Range

Set RgPartnumb = Range("E7:E46")
On Error Resume Next
For Each NRg In RgPartnumb
With NRg
.Comment.Delete
.AddComment Text:=NRg.Offset(0, 29).Text
.Comment.Shape.Select True
.Selection.ShapeRange.ScaleWidth 1.01, msoFalse, msoScaleFromTopLeft
.Selection.ShapeRange.ScaleHeight 0.93, msoFalse, msoScaleFromTopLeft
End With
Next

End Sub
Anyone have any ideas on these couple of things?

Thanks!
Thebatfink is offline   Reply With Quote
Old Jul 6th, 2007, 06:40 AM   #9
wildturkey
Board Regular
 
Join Date: Feb 2006
Posts: 113
Default

My first solution to someone elses problem even though its the result of mixing code from 2 other responses on these forums Im still chuffed.

Sub auto_open()
Dim RgPartnumb As Range
Dim NRg As Range

Set RgPartnumb = Range(Range("P1"), Range("P1").End(xlDown))
On Error Resume Next
For Each NRg In RgPartnumb
With NRg
.Comment.Delete
.AddComment Text:=NRg.Offset(0, 0).Text

End With
With NRg.Comment.Shape
.AutoShapeType = msoShapeRoundedRectangle
.Shadow.OffsetX = 20
.Shadow.OffsetY = 20
.Shadow.Transparency = 0.4
.Height = 150
.Width = 175
.IncrementLeft -150
End With
Next

End Sub
wildturkey is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On

Forum Jump


All times are GMT -4. The time now is 12:57 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
All contents Copyright 1998-2012 by MrExcel Consulting.
diabetic desserts recipes recipes Diabetic Soups Holiday Pizza Recipes Popcorn Recipes Recipes For Microwave Pasta Recipes Casserole Recipes Chili Recipes Curry Recipes Crockpot Recipes Apples Recipes Bread Recipes Vegetarian Recipes Vegetable recipes Desserts Recipes Appetizers Ethnic Recipes Meat Dishes Barbecue Recipes Sauces Recipes Marinade Recipes Low Fat Recipes Frugal Gourmet Kitchen Classics Recipes On The Grill Cook Books Seafood Recipes Cajun Recipes Breads Low Fat Low Fat Breads Bread Machine Recipes Yeast Breads Quick Breads Fat Free Vegetarian Salad Recipes Eggplant Recipes Radish Recipes Tomato Recipes Jalapeno Recipes Potato Recipes Lettuce Recipes Cabbage Recipes Beans Ambrosia Recipes Biscotti Recipes Desserts Low Fat Cookie Recipes Cheesecake Recipes Cake Recipes Pie Recipes Muffin Recipes Custard Recipes Best Appetizers Appetizers Low Fat Salsa Recipes Dip Recipes International Recipes Afghan Recipes Alaska Recipes French Recipes German Recipes Greek Recipes Italian Recipes Spanish Recipes Thai Recipes Korean Recipes Chinese Recipes Mexican Recipes Indian Recipes Beef Recipes Pork Pork & Ham Pork Butts Pork Chop Recipes Pork Ribs Rulled Pork Poultry Recipes Stews Recipes Ground Beef Barbecue Grill Barbecue Smoker All Purpose Sauce BBQ Sauce Barbecue Sauce Carolina BBQ Sauce Pickle Recipes Marinades Smoking Low Fat Appetizers & Dips Low Fat Breakfast Low Fat Cakes Low Fat Cheesecakes Low Fat Cookies Low Fat Desserts Low Fat Fish & Seafood Low Fat Meats Low Fat Pasta Low Fat Pies Low Fat Salads Low Fat Sandwiches Low Fat Sauces & Condiments Low Fat Sides Low Fat Soups Low Fat Vegetarian Baker's Dozen Taste of Home Recipe Book Bon Appetit Cookbook Blacktie Cookbook Buster Cook Book Cookbook USA Cook Book Cook Book Sara's Cookbook Sara's Cookbook Appetizers and Dips Poultry recipes Diabetic recipes Holiday recipes Miscellaneous recipes 110 recipes 1986 Usenet cookbook 2900 recipes Cyberrealm recipes Great sysops of world Specialty recipes Ceideburg recipes Cheese recipes Chili recipes Fruits recipes Garlic recipes Great chefs of NY Londontowne recipes Raisins recipes Recipes for kids US Food Vegetarian recipes Bread recipes Drinks Meat Dishes Brisket recipes Caribou recipes Chicken recipes Filet mignons recipes Pork recipes Swordfish recipes Turkey recipes Pasta recipes Uncategorized recipes Ethnic recipes Canada recipes English recipes Ethiopia recipes Germany recipes Greece recipes Mexican recipes Philippines recipes Welsh recipes Microwave recipes Soups recipes Vegetable recipes Asparagus recipes Barley recipes Brown rice recipes Lentil recipes Mushrooms recipes Salads recipes Wild rice Desserts recipes Cakes recipes Chocolate recipes Cookies recipes Ice cream recipes