Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pat Pat is offline
external usenet poster
 
Posts: 122
Default Execute warning message

When more than 256 characters have been entered into a cell I would like to
be warned of this by means of a message. When coping a workbook to a new
location where cells contain more than 256 characters these extra characters
are lost in the process. If i know in advance of the cells (of which there
will be many) I can at least divide the contents into two cells. Perhaps
conditional formatting could be applied here, what do you think?

Pat



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Execute warning message

You get the warning if you do it manually--but not via code.

If you think (or you'r not sure) that you have a worksheet that has more than
255 characters, then copy the sheet (just to get all the
formatting/controls/filters/pagesetup...).

Then go back and copy the cells and paste them to the newly created sheet.

Option Explicit
Sub testme()

Dim wksToCopy As Worksheet
Dim NewWks As Worksheet

Set wksToCopy = Worksheets("sheet1")
wksToCopy.Copy _
after:=wksToCopy

Set NewWks = ActiveSheet

wksToCopy.Cells.Copy _
Destination:=NewWks.Range("a1")

End Sub

I would think that this would be much faster than looking through each cell to
find the maximum length of a cell containing text.


Pat wrote:

When more than 256 characters have been entered into a cell I would like to
be warned of this by means of a message. When coping a workbook to a new
location where cells contain more than 256 characters these extra characters
are lost in the process. If i know in advance of the cells (of which there
will be many) I can at least divide the contents into two cells. Perhaps
conditional formatting could be applied here, what do you think?

Pat


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Execute warning message

Pat,

CF would indeed work. Paste this into the formula box (assuming the CF is
for A1) and copy the formatting:

=LEN(A1) 256

hth,

Doug

"Pat" wrote in message
...
When more than 256 characters have been entered into a cell I would like

to
be warned of this by means of a message. When coping a workbook to a new
location where cells contain more than 256 characters these extra

characters
are lost in the process. If i know in advance of the cells (of which

there
will be many) I can at least divide the contents into two cells. Perhaps
conditional formatting could be applied here, what do you think?

Pat





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default Execute warning message

How about Data - Validation (text length). Depending what you want exactly
this could be an option...
--
HTH...

Jim Thomlinson


"Pat" wrote:

When more than 256 characters have been entered into a cell I would like to
be warned of this by means of a message. When coping a workbook to a new
location where cells contain more than 256 characters these extra characters
are lost in the process. If i know in advance of the cells (of which there
will be many) I can at least divide the contents into two cells. Perhaps
conditional formatting could be applied here, what do you think?

Pat




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
warning message cufc1210 Excel Discussion (Misc queries) 2 September 30th 09 11:48 PM
Warning Message bollard Excel Worksheet Functions 6 September 12th 07 05:59 PM
Warning Message MLK Excel Worksheet Functions 2 June 29th 06 11:55 AM
How to I get a warning message box shrek Excel Worksheet Functions 3 November 10th 05 12:23 AM
warning message Delali Excel Programming 1 June 25th 04 06:40 PM


All times are GMT +1. The time now is 04:13 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"