Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

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


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


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





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
Watch Window Guilherme Excel Worksheet Functions 0 April 20th 09 02:12 PM
Watch Window Guilherme Excel Discussion (Misc queries) 0 April 20th 09 10:57 AM
Docking the Watch Window Richard Buttrey Excel Programming 2 October 8th 05 10:43 PM
VBA Watch Window Adam1 Chicago Excel Discussion (Misc queries) 0 February 24th 05 08:37 PM
Watch Window Subs Excel Programming 1 August 30th 04 03:18 PM


All times are GMT +1. The time now is 02:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"