ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Length (https://www.excelbanter.com/excel-programming/367956-length.html)

T De Villiers[_37_]

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


T De Villiers[_38_]

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


DS

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



Norman Jones

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





All times are GMT +1. The time now is 03:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com