Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Excel VBA truncate cells in a column

Posted on 2014-04-07
2
Medium Priority
?
1,504 Views
Last Modified: 2014-04-09
Hi,

I need to truncate all the data in each cell in column I to just the first 20 characters (alpha & numeric) I was trying to use this but this example truncates the data in all columns. It doesn't look like it should, but it does.

Edit: I'm not trying to delete spaces, just make the max = the first 20 characters.

    Sheets("Sheet1").Select
    Columns("I:I").Select
    Dim rCell As Range
    For Each rCell In Range("I1", Cells(Rows.Count, 1).End(xlUp))
        rCell = Left(rCell, 20)
    Next rCell
0
Comment
Question by:swjtx99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 36

Accepted Solution

by:
Kimputer earned 2000 total points
ID: 39984757
Replace one line:

For Each rCell In ActiveSheet.UsedRange.Columns("I").Cells
0
 

Author Closing Comment

by:swjtx99
ID: 39988970
Works!

Thanks,

swjtx99
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

: Microsoft Office Collaborate for free and online versions of Microsoft  Word, Excel, Powerpoint, OneNote, Onedrive , Email, Calendar etc. In short we can say that Microsoft office is a suite of servers, applications and services developed by  Micr…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Viewers will learn various types of data validation for different data types in Excel 2013.
Video by: Zack
Viewers will learn about using Excel in a browser with Excel Online.

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question