![]() |
WATCH WINDOW
Hi guys
does anyone know how to get a count of the number of characters in a cell from the VBA watch window, what do i type? Im sure this is is such as easy question but Ive exhausted every possibility of "count, character, excel, VBA" etc in google and I cant seem to find it! Many thanks Oz |
WATCH WINDOW
I add debug statement into my code like countchar = Range("A5").count. Then
add countchar into the watch window. " wrote: Hi guys does anyone know how to get a count of the number of characters in a cell from the VBA watch window, what do i type? Im sure this is is such as easy question but Ive exhausted every possibility of "count, character, excel, VBA" etc in google and I cant seem to find it! Many thanks Oz |
WATCH WINDOW
Joel,
Range("A5").count will always return 1 I think you meant to say countchar = len(Range("A5").value) or Countchar = range("A5").Characters.count for the Original Poster there is no property of a range that returns the count of the characters in the range. You can use Range("A5").Characters.count possibly. (I never use the watch window, so I can't say whether that is accessible or not). -- Regards, Tom Ogilvy "Joel" wrote: I add debug statement into my code like countchar = Range("A5").count. Then add countchar into the watch window. " wrote: Hi guys does anyone know how to get a count of the number of characters in a cell from the VBA watch window, what do i type? Im sure this is is such as easy question but Ive exhausted every possibility of "count, character, excel, VBA" etc in google and I cant seem to find it! Many thanks Oz |
WATCH WINDOW
Osman,
Have you tried the 'Len' function which returns the number of characters in a string? Regards Michael Beckinsale -----Original Message----- From: ] Posted At: 26 February 2007 14:31 Posted To: microsoft.public.excel.programming Conversation: WATCH WINDOW Subject: WATCH WINDOW Hi guys does anyone know how to get a count of the number of characters in a cell from the VBA watch window, what do i type? Im sure this is is such as easy question but Ive exhausted every possibility of "count, character, excel, VBA" etc in google and I cant seem to find it! Many thanks Oz |
WATCH WINDOW
In the Watch window, create a new watch of the expression Len(R.Value) where
R is a cell reference variable. This will update as you go from one cell to the other. If you just want the number of characters, you can do that from the Immediate window: ?Len(R.Value) ' or ?Len(Range("A1").Value) -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) wrote in message oups.com... Hi guys does anyone know how to get a count of the number of characters in a cell from the VBA watch window, what do i type? Im sure this is is such as easy question but Ive exhausted every possibility of "count, character, excel, VBA" etc in google and I cant seem to find it! Many thanks Oz |
All times are GMT +1. The time now is 07:16 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com