Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default UPPERCASE, lowercase issue

Having created a pivot table, it has raised the issue of the same data
entered in uppercase by one person, lowercase by another and normal case by
yet another. Can I programme the whole workbook to be normal case regardless
of user input?
--
tia

Jock
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default UPPERCASE, lowercase issue

Hi,

i way is worksheet change

Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If Not .HasFormula Then
Target.Value = StrConv(Target.Value, vbProperCase)
End If
End With
End Sub

you coould use
vbUpperCase
vbLowerCase

Mike

"Jock" wrote:

Having created a pivot table, it has raised the issue of the same data
entered in uppercase by one person, lowercase by another and normal case by
yet another. Can I programme the whole workbook to be normal case regardless
of user input?
--
tia

Jock

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default UPPERCASE, lowercase issue

Thanks Mike,
Can that be adapted to "workbook" or is that not a proper parameter?
Cheers,

Jock


"Mike H" wrote:

Hi,

i way is worksheet change

Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If Not .HasFormula Then
Target.Value = StrConv(Target.Value, vbProperCase)
End If
End With
End Sub

you coould use
vbUpperCase
vbLowerCase

Mike

"Jock" wrote:

Having created a pivot table, it has raised the issue of the same data
entered in uppercase by one person, lowercase by another and normal case by
yet another. Can I programme the whole workbook to be normal case regardless
of user input?
--
tia

Jock

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default UPPERCASE, lowercase issue

Jock,

Not tested but this should work for all sheets.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
With Target
If Not .HasFormula Then
Target.Value = StrConv(Target.Value, vbProperCase)
End If
End With
End Sub

Double click this workbook and paste in.

Mie

"Jock" wrote:

Thanks Mike,
Can that be adapted to "workbook" or is that not a proper parameter?
Cheers,

Jock


"Mike H" wrote:

Hi,

i way is worksheet change

Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If Not .HasFormula Then
Target.Value = StrConv(Target.Value, vbProperCase)
End If
End With
End Sub

you coould use
vbUpperCase
vbLowerCase

Mike

"Jock" wrote:

Having created a pivot table, it has raised the issue of the same data
entered in uppercase by one person, lowercase by another and normal case by
yet another. Can I programme the whole workbook to be normal case regardless
of user input?
--
tia

Jock

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default UPPERCASE, lowercase issue

Cool.
Thanks very much


Jock


"Mike H" wrote:

Jock,

Not tested but this should work for all sheets.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
With Target
If Not .HasFormula Then
Target.Value = StrConv(Target.Value, vbProperCase)
End If
End With
End Sub

Double click this workbook and paste in.

Mie

"Jock" wrote:

Thanks Mike,
Can that be adapted to "workbook" or is that not a proper parameter?
Cheers,

Jock


"Mike H" wrote:

Hi,

i way is worksheet change

Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If Not .HasFormula Then
Target.Value = StrConv(Target.Value, vbProperCase)
End If
End With
End Sub

you coould use
vbUpperCase
vbLowerCase

Mike

"Jock" wrote:

Having created a pivot table, it has raised the issue of the same data
entered in uppercase by one person, lowercase by another and normal case by
yet another. Can I programme the whole workbook to be normal case regardless
of user input?
--
tia

Jock



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default UPPERCASE, lowercase issue

If you don't want your workbook to slow way down from recursive calls to the
SheetChange event and you don't want error messages when multiple cells are
changed (such as clearing a block of cells), you might modify your code along
these lines:


Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
On Error goto ErrHandler
Application.EnableEvents = False
for each cell in Target
With cell
If Not .HasFormula Then
cell.Value = StrConv(cell.Value, vbProperCase)
End If
End With
Next cell
ErrHandler:
Application.EnableEvents = True
End Sub

--
Regards,
Tom Ogilvy

"Jock" wrote:

Cool.
Thanks very much


Jock


"Mike H" wrote:

Jock,

Not tested but this should work for all sheets.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
With Target
If Not .HasFormula Then
Target.Value = StrConv(Target.Value, vbProperCase)
End If
End With
End Sub

Double click this workbook and paste in.

Mie

"Jock" wrote:

Thanks Mike,
Can that be adapted to "workbook" or is that not a proper parameter?
Cheers,

Jock


"Mike H" wrote:

Hi,

i way is worksheet change

Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If Not .HasFormula Then
Target.Value = StrConv(Target.Value, vbProperCase)
End If
End With
End Sub

you coould use
vbUpperCase
vbLowerCase

Mike

"Jock" wrote:

Having created a pivot table, it has raised the issue of the same data
entered in uppercase by one person, lowercase by another and normal case by
yet another. Can I programme the whole workbook to be normal case regardless
of user input?
--
tia

Jock

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
Lowercase to uppercase workingwoman Excel Discussion (Misc queries) 3 September 14th 07 08:46 PM
uppercase to lowercase wagz Excel Programming 2 June 8th 07 06:19 PM
lowercase to uppercase Pekka Excel Programming 3 May 10th 07 05:54 PM
uppercase to lowercase Missy Excel Worksheet Functions 1 February 3rd 05 09:10 PM
lowercase to uppercase Louise Excel Worksheet Functions 6 January 10th 05 09:41 PM


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