Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default count of changed data

Hello,
I am using a macro to lower case selected areas.
How can I correctly print the number of cells changed, rather than
visited?

Sub lowerme()
Dim cell As Object
Dim count As Integer
count = 0
For Each cell In Selection
count = count + 1
cell.Value = LCase(cell.Value)
Next cell
MsgBox count & " Cells Changed "
End Sub

TIA

Ton

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default count of changed data

This worked for me:
If cell.Value < LCase(cell.Value) Then count = count + 1

Of course, you need this before you change a cell.

Hth,
Merjet


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default count of changed data



"ton de w" wrote:

Hello,
I am using a macro to lower case selected areas.
How can I correctly print the number of cells changed, rather than
visited?

Sub lowerme()
Dim cell As Object
Dim count As Integer
count = 0
changed = 0
For Each cell In Selection
oldvalue = cell.Value
count = count + 1
cell.Value = LCase(cell.Value)
if oldvalue < cell.value then
changed = changed + 1
end if
Next cell
MsgBox count & Changed
End Sub

TIA

Ton


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
Count on cell for each time it is changed Jelinek Excel Discussion (Misc queries) 3 January 9th 06 02:22 PM
I need to keep a count of the times a cell is changed Paul Cahoon Excel Discussion (Misc queries) 2 December 29th 05 03:10 PM
How to count the number of cell changed since yesterday? magickarle Excel Programming 9 December 7th 05 05:22 PM
Charts not recognizing source data if original linked data is changed. JLC Charts and Charting in Excel 3 October 14th 05 01:29 AM
Count How Many Times A Cell's Value Has Been Changed Avais Excel Programming 4 April 24th 05 04:25 AM


All times are GMT +1. The time now is 07:28 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"