How do I display character count on the status bar?

  • Thread starter Thread starter user061803
  • Start date Start date
U

user061803

Hello -

I need the counter in the status bar that will show me how many characters
are in each cell.
 
Right-Click the worksheet tab and choose View Code, then copy the following
code

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
c = Len(ActiveCell)
Application.StatusBar = c & " characters"
End Sub

Peter
 
You should also use the following

Private Sub Worksheet_Deactivate()
Application.StatusBar = ""
End Sub

and in the workbook module:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.StatusBar = ""
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.StatusBar = ""
End Sub

Private Sub Workbook_Deactivate()
Application.StatusBar = ""
End Sub

Just to tidy things up

Peter
 
Back
Top