Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 221
Default Auto Capital - (Further Question)

Mike / Gord

Just had another thought regarding capitalising.

And yep! It would be just as easy to use the <Caps Lock, but most of the
"Gate-house" staff are all-but illiterate (as they are mostly imports and
have limited english, let alone computer skills), and they (the Company) are
losing information integrity, so here I am, trying to maintain that
continuity.

That Said! can I set the entire range as <Caps using the Workbook On_Open
event.

something like:

Private Sub Workbook_Open()

Dim MyWB As Workbook
Dim MyWS As Worksheet
Dim MySR As Range

Application.ScreenUpdating = False

Set MyWB = ActiveWorkbook
Set MyWS = GateLog

MySR = "A1:K10000"
MyWS = UCase(MySR)

Application.ScreenUpdating = True

End Sub

This resulted in the following error:

Runtime Error '424'
Object Required

Appreciate any guidance.

TIA
Mark.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Auto Capital - (Further Question)

Hello,
you could also use

Private Sub Workbook_Open()

Dim C as range

Application.ScreenUpdating = False
Range("A1:K10000").select
For Each C In Selection
C.Value = Ucase(C.Value)
Next
Application.ScreenUpdating = True
End Sub
--
Kevin Smith :o)


"NoodNutt" wrote:

Mike / Gord

Just had another thought regarding capitalising.

And yep! It would be just as easy to use the <Caps Lock, but most of the
"Gate-house" staff are all-but illiterate (as they are mostly imports and
have limited english, let alone computer skills), and they (the Company) are
losing information integrity, so here I am, trying to maintain that
continuity.

That Said! can I set the entire range as <Caps using the Workbook On_Open
event.

something like:

Private Sub Workbook_Open()

Dim MyWB As Workbook
Dim MyWS As Worksheet
Dim MySR As Range

Application.ScreenUpdating = False

Set MyWB = ActiveWorkbook
Set MyWS = GateLog

MySR = "A1:K10000"
MyWS = UCase(MySR)

Application.ScreenUpdating = True

End Sub

This resulted in the following error:

Runtime Error '424'
Object Required

Appreciate any guidance.

TIA
Mark.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Auto Capital - (Further Question)

I don't know how to set a blank range to UPPER case using workbook_open
code.

Why don't you simply edit the range in the worksheet event code you were
given?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Const WS_RANGE As String = "A1:K10000"
On Error GoTo ErrHandler
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
Target.Formula = UCase(Target.Formula)
End If
ErrHandler:
Application.EnableEvents = True
End Sub


Gord

On Thu, 24 Sep 2009 12:25:50 +1000, "NoodNutt" wrote:

Mike / Gord

Just had another thought regarding capitalising.

And yep! It would be just as easy to use the <Caps Lock, but most of the
"Gate-house" staff are all-but illiterate (as they are mostly imports and
have limited english, let alone computer skills), and they (the Company) are
losing information integrity, so here I am, trying to maintain that
continuity.

That Said! can I set the entire range as <Caps using the Workbook On_Open
event.

something like:

Private Sub Workbook_Open()

Dim MyWB As Workbook
Dim MyWS As Worksheet
Dim MySR As Range

Application.ScreenUpdating = False

Set MyWB = ActiveWorkbook
Set MyWS = GateLog

MySR = "A1:K10000"
MyWS = UCase(MySR)

Application.ScreenUpdating = True

End Sub

This resulted in the following error:

Runtime Error '424'
Object Required

Appreciate any guidance.

TIA
Mark.


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Auto Capital - (Further Question)

Kevin

That would take quite a while to run every time the workbook was opened.

And it would not auto-change case in newly entered cells.


Gord Dibben MS Excel MVP


On Thu, 24 Sep 2009 00:58:01 -0700, Kevin Smith
wrote:

Hello,
you could also use

Private Sub Workbook_Open()

Dim C as range

Application.ScreenUpdating = False
Range("A1:K10000").select
For Each C In Selection
C.Value = Ucase(C.Value)
Next
Application.ScreenUpdating = True
End Sub


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 221
Default Auto Capital - (Further Question)

Kev

Thank you for your suggestion, although, I went with Gord's answer, I
appreciate your efforts though.

Gord

The original Code you provided had a small glitch in that it did not auto
cap until I clicked back on the cell again, dunno why it was doing it, but I
must thank you as this is by far a better alternative and works a treat.

Thx heaps to both.

Regards
Mark.





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Auto Capital - (Further Question)

I don't know why that would occur unless you altered the posted event type
to a selectionchange event.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

But, good to hear you're happy.


Gord

On Fri, 25 Sep 2009 03:13:14 +1000, "NoodNutt" wrote:

The original Code you provided had a small glitch in that it did not auto
cap until I clicked back on the cell again, dunno why it was doing it, but I
must thank you as this is by far a better alternative and works a treat.


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
Auto filter question AN Excel Worksheet Functions 1 June 20th 08 11:28 AM
Auto Capital Letter in a cell Montu Excel Worksheet Functions 3 January 8th 08 02:12 PM
Auto capital letter in a cell Montu Excel Worksheet Functions 3 December 22nd 07 11:21 PM
Auto change font to 'capital letters' Anthony Excel Worksheet Functions 3 February 12th 05 03:10 PM
auto filter question Juco Excel Worksheet Functions 0 November 29th 04 02:48 PM


All times are GMT +1. The time now is 07:50 PM.

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"