Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Limit characters

I use the code below to populate column A. Is there any way to change the
code to limit it to the first 15 characters from the left?

Me.Range("A2:A301").Value = Me.Range("B2:B301").Value


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Limit characters

Try this:

Me.Range("A2:A301")= Left(Me.Range("B2:B301").Value,15)


"Patrick Simonds" wrote:

I use the code below to populate column A. Is there any way to change the
code to limit it to the first 15 characters from the left?

Me.Range("A2:A301").Value = Me.Range("B2:B301").Value



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Limit characters

Does not seem to work.

The range B2:B301 contains the following code:

=IF(C65="zxz","",IF(COUNTIF(C65:D65,""""),IF($R$1 =1,TEXT(C65,"") &"
"&TEXT(D65,""),TEXT(D65,"") &", "&TEXT(C65,"")),""))

This combines text from Columns D (Last Name) with Column C (First Name) and
places a , between them. But when I run the code:

Me.Range("A2:A301")= Left(Me.Range("B2:B301").Value,15)

Nothing happens.




"JLGWhiz" wrote in message
...
Try this:

Me.Range("A2:A301")= Left(Me.Range("B2:B301").Value,15)


"Patrick Simonds" wrote:

I use the code below to populate column A. Is there any way to change the
code to limit it to the first 15 characters from the left?

Me.Range("A2:A301").Value = Me.Range("B2:B301").Value





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default Limit characters

For Each cell In Me.Range("A2:A301")
cell.Value = Left(cell.Value, 15)
Next cell

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"Patrick Simonds" wrote in message
...
I use the code below to populate column A. Is there any way to change the
code to limit it to the first 15 characters from the left?

Me.Range("A2:A301").Value = Me.Range("B2:B301").Value



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
Limit to 5 characters... Astro Excel Worksheet Functions 2 January 20th 09 03:00 AM
How to limit the characters in a cell Igneshwara reddy[_2_] Excel Worksheet Functions 1 June 16th 08 03:32 PM
How do I limit characters in a cell? casey Excel Worksheet Functions 5 October 4th 06 01:33 AM
limit of characters in Excell Jola Excel Discussion (Misc queries) 1 September 20th 06 10:52 AM
SQL limit of 255 characters DB Excel Programming 2 December 8th 05 07:22 PM


All times are GMT +1. The time now is 01:20 AM.

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

About Us

"It's about Microsoft Excel"