#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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


--
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Length


Actually very easy, no probs, 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
DS DS is offline
external usenet poster
 
Posts: 117
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Length

Hi T,

Use VBA's Len function:

Dim iLen as long

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


---
Regards,
Norman



"T De Villiers"
wrote in message
news:T.De.Villiers.2batqr_1153491008.9545@excelfor um-nospam.com...

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
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
Length of Employment Blessedx3 Excel Worksheet Functions 2 March 11th 09 07:11 PM
Length that falls within a length interval? Igorin Excel Worksheet Functions 4 November 20th 08 06:10 PM
Finding a string of unknown length in a string of unknown length, Help! Hankjam[_2_] Excel Discussion (Misc queries) 8 July 3rd 08 06:49 PM
Validation length, Range length I think I need to rephrase the question Excel Discussion (Misc queries) 5 September 17th 07 06:29 AM
Max Length UNOTech Excel Programming 0 March 17th 05 10:29 PM


All times are GMT +1. The time now is 09:35 PM.

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"