+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17

Thread: maintain only first word in a cell

  1. #16
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: maintain only first word in a cell

    @Ricardo - perhaps worth ensuring that the Split is assigned to first non-blank (ie account for possibility that A1 is blank etc)

    @patentprio - If :

    a) the values are constants

    b) blanks are real blanks (not Nulls, spaces etc)

    c) number of rows specified is never excessive

    you might find you can avoid iteration courtesy of a SpecialCells approach, ie:

    Sub Example()
    With Sheets("Sheet1")
        With .Range(.Cells(1, "A"), .Cells(.Rows.Count, "A").End(xlUp)).SpecialCells(xlCellTypeConstants)
            .Value = Split(.Cells(1).Value, " ")(0)
        End With
    End With
    End Sub
    (you could also consider using an AutoFilter method)

  2. #17
    Registered User
    Join Date
    03-02-2010
    Location
    Switzerland
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: maintain only first word in a cell

    Great. It is solved!!!

    Thank you so much.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0