Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro syntax to check string length in a cell
I'm trying to find the VB syntax for checking the length of a string in a
cell. Any takers? I'm stuck. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro syntax to check string length in a cell
mystring = ActiveCell.Value
mylen = Len(mystring) MsgBox mylen Gord Dibben MS Excel MVP On Wed, 1 Nov 2006 12:16:02 -0800, El Bee wrote: I'm trying to find the VB syntax for checking the length of a string in a cell. Any takers? I'm stuck. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro syntax to check string length in a cell
Sub lcheck()
MsgBox (Len(Selection.Value)) End Sub Select a cell adn run the macro. -- Gary's Student "El Bee" wrote: I'm trying to find the VB syntax for checking the length of a string in a cell. Any takers? I'm stuck. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Macro syntax to check string length in a cell
if len(worksheets("sheet1").range("a1").value) 3 then
or if len(worksheets("sheet1").range("a1").text) 3 then ..text is what you see in the cell. .value is what the cell actually contains. === If you put 3 in a cell, the .value is 3. But if you format it to show $3.00, then .text is $3.00 El Bee wrote: I'm trying to find the VB syntax for checking the length of a string in a cell. Any takers? I'm stuck. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
insert date | Excel Worksheet Functions | |||
Row Expansion | Excel Worksheet Functions | |||
checking that cells have a value before the workbook will close | Excel Worksheet Functions | |||
Copy cell format to cell on another worksht and update automatical | Excel Worksheet Functions | |||
GET.CELL | Excel Worksheet Functions |