+ Reply to Thread
Results 1 to 3 of 3

limiting characters in a cell by formula

Hybrid View

  1. #1
    Campbell
    Guest

    limiting characters in a cell by formula

    Hi,

    I am trying to import some information into another software system from
    excel, unfortunatley in one particular field there is a limit to the amount
    of characters that can be entered, so when I try to import the file it's
    rejected.

    Is there a way I can limit the amount of characters in excel, for example
    the original cell might say "this can't be right" but I need a formula to
    limit the amount of characters to say 10 to bring it down to "this can't".

    does anyone know of a way to do this, I have a feeling there is a way via
    macros or VBA but I am not to flash at these.

    Cheers

    Campbell

  2. #2
    britwiz@hotmail.com
    Guest

    Re: limiting characters in a cell by formula


    Campbell wrote:
    > Hi,
    > Is there a way I can limit the amount of characters in excel, for example
    > the original cell might say "this can't be right" but I need a formula to
    > limit the amount of characters to say 10 to bring it down to "this can't".


    > Cheers
    >
    > Campbell


    Hi Campbell

    The formula you want is:

    =LEFT(A1,10)

    The vba you might want is:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column <> 1 Then Exit Sub
    Target = Left(Target, 10)
    End Sub

    The macro checks the column to limit, in this case column A; amend it
    as necessary.

    Regards

    Steve


  3. #3
    britwiz@hotmail.com
    Guest

    Re: limiting characters in a cell by formula


    Campbell wrote:
    > Hi,
    > Is there a way I can limit the amount of characters in excel, for example
    > the original cell might say "this can't be right" but I need a formula to
    > limit the amount of characters to say 10 to bring it down to "this can't".


    > Cheers
    >
    > Campbell


    Hi Campbell

    The formula you want is:

    =LEFT(A1,10)

    The vba you might want is:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Column <> 1 Then Exit Sub
    Target = Left(Target, 10)
    End Sub

    The macro checks the column to limit, in this case column A; amend it
    as necessary.

    Regards

    Steve


+ 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.6.0 RC 1