PC Review


Reply
Thread Tools Rate Thread

confine text to cell

 
 
=?Utf-8?B?U3RldmU=?=
Guest
Posts: n/a
 
      21st Apr 2007
I'm trying to create a macro that will confine my text to its own cell (ie so
it doesn't spill over to the next). I know I could use alignment options
'text wrap' or 'shrink to fit' however I prefer what I call the cut-off look
where neither the cell nor the text are resized, just the text cut off from
view at the point that it extends beyond its cell border.

Reason for my preference: usually all I need to see is the first 3 letters
of a cell entry and I like to keep my cell and font cells to a regular size
to reduce mental fatigue.

The macro I created only worked with the particular cell I used in the
recording. I based it around the following 3 steps; move to next cell right,
insert space (thus preventing spillover) retreat to home cell

I suppose I could create a template with the whole sheet preset to this
arrangment but also need to do it retroactively to existing sheets.
 
Reply With Quote
 
 
 
 
Tim Williams
Guest
Posts: n/a
 
      21st Apr 2007
Select your range with the text you want to truncate then:

selection.offset(0,1).value=" "

Tim

"Steve" <(E-Mail Removed)> wrote in message
news:11E4F644-781F-46A9-BF3B-(E-Mail Removed)...
> I'm trying to create a macro that will confine my text to its own cell (ie
> so
> it doesn't spill over to the next). I know I could use alignment options
> 'text wrap' or 'shrink to fit' however I prefer what I call the cut-off
> look
> where neither the cell nor the text are resized, just the text cut off
> from
> view at the point that it extends beyond its cell border.
>
> Reason for my preference: usually all I need to see is the first 3 letters
> of a cell entry and I like to keep my cell and font cells to a regular
> size
> to reduce mental fatigue.
>
> The macro I created only worked with the particular cell I used in the
> recording. I based it around the following 3 steps; move to next cell
> right,
> insert space (thus preventing spillover) retreat to home cell
>
> I suppose I could create a template with the whole sheet preset to this
> arrangment but also need to do it retroactively to existing sheets.



 
Reply With Quote
 
=?Utf-8?B?SmF5?=
Guest
Posts: n/a
 
      21st Apr 2007
Hi Steve -

Similar to Tim's version. Click on any cell anywhere in the column that
contains the text and run this:

Sub cutOff()
With Range(Cells(ActiveSheet.UsedRange.Row, ActiveCell.Column), _
Cells(ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row, _
ActiveCell.Column))
.Offset(0, 1) = Chr(32)
End With
End Sub
---
Jay


"Steve" wrote:

> I'm trying to create a macro that will confine my text to its own cell (ie so
> it doesn't spill over to the next). I know I could use alignment options
> 'text wrap' or 'shrink to fit' however I prefer what I call the cut-off look
> where neither the cell nor the text are resized, just the text cut off from
> view at the point that it extends beyond its cell border.
>
> Reason for my preference: usually all I need to see is the first 3 letters
> of a cell entry and I like to keep my cell and font cells to a regular size
> to reduce mental fatigue.
>
> The macro I created only worked with the particular cell I used in the
> recording. I based it around the following 3 steps; move to next cell right,
> insert space (thus preventing spillover) retreat to home cell
>
> I suppose I could create a template with the whole sheet preset to this
> arrangment but also need to do it retroactively to existing sheets.

 
Reply With Quote
 
=?Utf-8?B?U3RldmU=?=
Guest
Posts: n/a
 
      21st Apr 2007
Brilliant - worked first time!

"Tim Williams" wrote:

> Select your range with the text you want to truncate then:
>
> selection.offset(0,1).value=" "
>
> Tim
>
> "Steve" <(E-Mail Removed)> wrote in message
> news:11E4F644-781F-46A9-BF3B-(E-Mail Removed)...
> > I'm trying to create a macro that will confine my text to its own cell (ie
> > so
> > it doesn't spill over to the next). I know I could use alignment options
> > 'text wrap' or 'shrink to fit' however I prefer what I call the cut-off
> > look
> > where neither the cell nor the text are resized, just the text cut off
> > from
> > view at the point that it extends beyond its cell border.
> >
> > Reason for my preference: usually all I need to see is the first 3 letters
> > of a cell entry and I like to keep my cell and font cells to a regular
> > size
> > to reduce mental fatigue.
> >
> > The macro I created only worked with the particular cell I used in the
> > recording. I based it around the following 3 steps; move to next cell
> > right,
> > insert space (thus preventing spillover) retreat to home cell
> >
> > I suppose I could create a template with the whole sheet preset to this
> > arrangment but also need to do it retroactively to existing sheets.

>
>
>

 
Reply With Quote
 
=?Utf-8?B?U3RldmU=?=
Guest
Posts: n/a
 
      21st Apr 2007
Thanks Jay!
Cheers
Steve

"Jay" wrote:

> Hi Steve -
>
> Similar to Tim's version. Click on any cell anywhere in the column that
> contains the text and run this:
>
> Sub cutOff()
> With Range(Cells(ActiveSheet.UsedRange.Row, ActiveCell.Column), _
> Cells(ActiveSheet.UsedRange.SpecialCells(xlCellTypeLastCell).Row, _
> ActiveCell.Column))
> .Offset(0, 1) = Chr(32)
> End With
> End Sub
> ---
> Jay
>
>
> "Steve" wrote:
>
> > I'm trying to create a macro that will confine my text to its own cell (ie so
> > it doesn't spill over to the next). I know I could use alignment options
> > 'text wrap' or 'shrink to fit' however I prefer what I call the cut-off look
> > where neither the cell nor the text are resized, just the text cut off from
> > view at the point that it extends beyond its cell border.
> >
> > Reason for my preference: usually all I need to see is the first 3 letters
> > of a cell entry and I like to keep my cell and font cells to a regular size
> > to reduce mental fatigue.
> >
> > The macro I created only worked with the particular cell I used in the
> > recording. I based it around the following 3 steps; move to next cell right,
> > insert space (thus preventing spillover) retreat to home cell
> >
> > I suppose I could create a template with the whole sheet preset to this
> > arrangment but also need to do it retroactively to existing sheets.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Confine Cell to Proper Case igbert Microsoft Excel Misc 2 11th Feb 2010 12:16 AM
confine cells to two digits hoysala Microsoft Excel Programming 3 25th Jan 2008 07:44 PM
select text in cell based on text from another cell, paste the text at the begining of a thrid cell, etc... jsd219 Microsoft Excel Programming 0 19th Oct 2006 05:04 PM
when text and images confine to width of window browser geegee Microsoft Frontpage 2 16th Aug 2006 10:54 AM
Confine results of web query to one cell =?Utf-8?B?SmF5UGF0dGVyc29u?= Microsoft Excel Misc 0 24th Dec 2004 03:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:57 AM.