Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default cell overflow problems

I played with some code and if you need to modify the sentences, this works pretty well.
Put this macro on the ThisWorkbook sheet. To activate you just double click on the cell that needs the comment added
you could add IF statements if you need to limit the cells that can be changed either by individual cells or specific columns or rows ( IF LEFT(TEMP,2) = $A THEN .... would limit the macro to column A only)

dim TEMP, COM as string
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean)
TEMP = Target.Address
' OPTIONAL IF STATEMENT HERE
COM = Range(TEMP)
Range(TEMP).Select
On Error GoTo 10
Range(TEMP).AddComment
Range(TEMP).Comment.Visible = False
With Selection.Font
.Name = "Tahoma"
.FontStyle = "Regular"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range(TEMP).Comment.Shape.ScaleHeight 0.3, msoFalse, msoScaleFromTopLeft
Range(TEMP).Comment.Shape.ScaleWidth 2.78, msoFalse, msoScaleFromTopLeft
10 Range(TEMP).Comment.Text Text:= COM
ActiveCell.Next.Select
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
need way to handle large csv imports that overflow cell size remay Excel Discussion (Misc queries) 3 March 6th 07 02:04 PM
allow text to overflow into the next cell? gbwoodman Excel Discussion (Misc queries) 1 February 7th 06 12:42 PM
Text Cell Overflow tonymaguire Excel Discussion (Misc queries) 4 October 6th 05 08:32 AM
VBA overflow Tom Ogilvy Excel Programming 3 September 2nd 03 09:04 PM
VBA overflow Don Guillett[_4_] Excel Programming 2 September 2nd 03 04:19 PM


All times are GMT +1. The time now is 08:52 PM.

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"