+ Reply to Thread
Results 1 to 4 of 4

Length

  1. #1
    Forum Contributor
    Join Date
    08-20-2005
    Posts
    173

    Length

    I am trying to establish the length of a cell in vba

    So if one would like to find the length of A1

    then len(A1)

    however in VBA dont think I can use worksheetfunction.len,

    any ideas, many thks

  2. #2
    Forum Contributor
    Join Date
    08-20-2005
    Posts
    173

    i'm OK

    Actually very easy, no probs, thks

  3. #3
    DS
    Guest

    RE: Length

    Hi,

    if you use

    Len(Range("A1"))

    This will give you the character length of the entry in that cell.

    HTH
    DS

    "T De Villiers" wrote:

    >
    > I am trying to establish the length of a cell in vba
    >
    > So if one would like to find the length of A1
    >
    > then len(A1)
    >
    > however in VBA dont think I can use worksheetfunction.len,
    >
    > any ideas, many thks
    >
    >
    > --
    > T De Villiers
    > ------------------------------------------------------------------------
    > T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479
    > View this thread: http://www.excelforum.com/showthread...hreadid=563705
    >
    >


  4. #4
    Norman Jones
    Guest

    Re: Length

    Hi T,

    Use VBA's Len function:

    Dim iLen as long

    iLen = Len(Range("A1").Value)


    ---
    Regards,
    Norman



    "T De Villiers" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I am trying to establish the length of a cell in vba
    >
    > So if one would like to find the length of A1
    >
    > then len(A1)
    >
    > however in VBA dont think I can use worksheetfunction.len,
    >
    > any ideas, many thks
    >
    >
    > --
    > T De Villiers
    > ------------------------------------------------------------------------
    > T De Villiers's Profile:
    > http://www.excelforum.com/member.php...o&userid=26479
    > View this thread: http://www.excelforum.com/showthread...hreadid=563705
    >




+ 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