#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default CAPITALISE GLOBALLY

I have a worksheet typed in upper and lower case. Is there a command I could
use to globally change it to UPPER CASE?

Prasad Gopinath
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default CAPITALISE GLOBALLY

Hi again,

Put this in a module

Sub mersible()
Set myrange = ActiveSheet.UsedRange
On Error Resume Next
For Each c In myrange
c.Value = UCase(c.Value)
Next
End Sub

Mike

"Prasad Gopinath" wrote:

I have a worksheet typed in upper and lower case. Is there a command I could
use to globally change it to UPPER CASE?

Prasad Gopinath

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default CAPITALISE GLOBALLY

Mike

Forgive my ignorance. What is a "Module"?

Prasad




"Mike H" wrote:

Hi again,

Put this in a module

Sub mersible()
Set myrange = ActiveSheet.UsedRange
On Error Resume Next
For Each c In myrange
c.Value = UCase(c.Value)
Next
End Sub

Mike

"Prasad Gopinath" wrote:

I have a worksheet typed in upper and lower case. Is there a command I could
use to globally change it to UPPER CASE?

Prasad Gopinath

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default CAPITALISE GLOBALLY

Firstly don't use the first one it will change you formula into values so
apologies for that and use the second one.

To create a module tap ALT + Fll to open VB editor then
right click 'this workbook' and insert module and paste your code in on the
right hand side. It will then work on the active worksheet.

Mike

"Prasad Gopinath" wrote:

Mike

Forgive my ignorance. What is a "Module"?

Prasad




"Mike H" wrote:

Hi again,

Put this in a module

Sub mersible()
Set myrange = ActiveSheet.UsedRange
On Error Resume Next
For Each c In myrange
c.Value = UCase(c.Value)
Next
End Sub

Mike

"Prasad Gopinath" wrote:

I have a worksheet typed in upper and lower case. Is there a command I could
use to globally change it to UPPER CASE?

Prasad Gopinath

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default CAPITALISE GLOBALLY

Alt + F11 to open VBEditor.

CTRL + r to open Porject Explorer.

Right-click your workbook/project and InsertModule.

I will caution you against running the macro Mike provided if there might be any
formulas in the usedrange.

The code will change all formulas to values.

Revised code to prevent that.....................

Sub mersible()
Set myrange = ActiveSheet.UsedRange
On Error Resume Next
For Each c In myrange
c.Formula = UCase(c.Formula)
Next
End Sub

Or trap for formulas....................

Sub mersible()
Set myrange = ActiveSheet.UsedRange
On Error Resume Next
For Each c In myrange
If Not c.HasFormula Then
c.Value = UCase(c.Value)
End If
Next
End Sub


Gord Dibben MS Excel MVP

On Sun, 10 Feb 2008 12:42:02 -0800, Prasad Gopinath
wrote:

Mike

Forgive my ignorance. What is a "Module"?

Prasad




"Mike H" wrote:

Hi again,

Put this in a module

Sub mersible()
Set myrange = ActiveSheet.UsedRange
On Error Resume Next
For Each c In myrange
c.Value = UCase(c.Value)
Next
End Sub

Mike

"Prasad Gopinath" wrote:

I have a worksheet typed in upper and lower case. Is there a command I could
use to globally change it to UPPER CASE?

Prasad Gopinath




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default CAPITALISE GLOBALLY

Sorry an error in that one , use this instead

Sub mersible()
Set myrange = ActiveSheet.UsedRange
On Error Resume Next
For Each c In myrange
If Not IsNumeric(c.Value) Then
c.Value = UCase(c.Value)
End If
Next
End Sub

Mike

"Prasad Gopinath" wrote:

I have a worksheet typed in upper and lower case. Is there a command I could
use to globally change it to UPPER CASE?

Prasad Gopinath

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
CAPITALISE Prasad Gopinath Excel Discussion (Misc queries) 8 March 1st 08 03:36 PM
Globally replacing * Bowler Excel Discussion (Misc queries) 2 November 6th 07 10:47 AM
Can I globally add to a worksheet? oldsquid Excel Worksheet Functions 2 February 23rd 07 11:38 PM
how can i capitalise text in an existing workbook craigs rus Excel Worksheet Functions 1 October 31st 06 07:56 PM
Trying to Capitalise on Input to Cells John Excel Worksheet Functions 3 June 23rd 06 03:18 PM


All times are GMT +1. The time now is 04:35 AM.

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"