Convert to Uppercase – Excel VBA Codes:
To insert vba code for worksheet event procedures, right click on the Worksheet name tab, select View Code and paste the code into the Code Window that appears at right.
Convert Text and Cells with Formulas to UpperCase – worksheet event procedure
Private Sub Worksheet_Change(ByVal Target As Range)
‘Forces any cell entry (text or formula) in the target column to be UPPER case
‘Target is an argument which refers to the range being changed
‘worksheet event procedures (ex. worksheet Change Event) are installed with the worksheet ie. the code must be placed in the code module of the appropriate Sheet object
‘for any change in column A
If Target.Column = 1 Then
‘this check prevents the procedure from repeatedly calling itself (ie. recursing)
If Not Target.Text = UCase(Target.Text) Then
If Target.HasFormula = True Then
‘Mid(Target.Formula, 2): eliminates “=” from the formula text
Target.Formula = “=UPPER(” & Mid(Target.Formula, 2) & “)”
Else
Target = UCase(Target.Text)
End If
End If
End If
End Sub
Convert Text and Cells with Formulas to UpperCase – worksheet event procedure
Private Sub Worksheet_Change(ByVal Target As Range)
‘Forces any cell entry (text or formula) in the target column to be UPPER case
‘Target is an argument which refers to the range being changed
‘worksheet event procedures (ex. worksheet Change Event) are installed with the worksheet ie. the code must be placed in the code module of the appropriate Sheet object
With Target
If .Column = 1 Then
‘this check prevents the procedure from repeatedly calling itself (ie. recursing)
If .Value <> UCase(.Value) Then
‘for any change in column A
If .HasFormula = True Then
‘Right(.Formula, Len(.Formula) – 1): eliminates “=” from the formula text
.Formula = “=UPPER(” & Right(.Formula, Len(.Formula) – 1) & “)”
‘Alternately:
‘.Formula = “=UPPER(” & Mid(.Formula, 2) & “)”
‘Mid(Target.Formula, 2): eliminates “=” from the formula text
Else
.Value = UCase(.Value)
End If
End If
End If
End With
End Sub
Convert Text and Cells with Formulas to UpperCase – worksheet event procedure
Private Sub Worksheet_Change(ByVal Target As Range)
‘Forces any cell entry (text or formula) in the target range to be UPPER case
‘Target is an argument which refers to the range being changed
‘Change A1:C10 to the desired range
‘worksheet event procedures (ex. worksheet Change Event) are installed with the worksheet ie. the code must be placed in the code module of the appropriate Sheet object
With Target
If Not Application.Intersect(Target, Range(“A1:C10”)) Is Nothing Then
‘this check prevents the procedure from repeatedly calling itself (ie. recursing)
If .Value <> UCase(.Value) Then
If .HasFormula = True Then
‘Right(.Formula, Len(.Formula) – 1): eliminates “=” from the formula text
.Formula = “=UPPER(” & Right(.Formula, Len(.Formula) – 1) & “)”
‘Alternately:
‘.Formula = “=UPPER(” & Mid(.Formula, 2) & “)”
‘Mid(Target.Formula, 2): eliminates “=” from the formula text
Else
.Value = UCase(.Value)
End If
End If
End If
End With
End Sub
Convert Text to UpperCase – vba code
Sub Uppercase1()
‘To convert the selected range to UpperCase, only if it is text and not formula
‘Use “LCase” instead of “UCase” to convert from UpperCase to LowerCase
‘not being a worksheet event procedure, this macro can be placed in a standard module & on execution will convert the selected range to UpperCase
Dim Cell As Range
For Each Cell In Selection.Cells
If Not Cell.HasFormula Then
Cell = UCase(Cell)
End If
Next
End Sub
Convert Text and Cells with Formulas to UpperCase with VBA
VBA TUTORIAL LOGIN
Hi ,Logout
Cond Statements in VBA Test
Text Strings in VBA
Custom Number Formats
Excel VBA Built-in Events
ActiveX & Form Controls
Application.OnTime Method
MsgBox & InputBox in VBA
- Ebook of Excel Solutions
- Excel Formulas Ebook
- Ebook of Excel Formulas
- Extract Values which appear ONLY once, from a Column
- Count Groups of Consecutive Positive Values
- SUM Max values of Each Row, in a Multiple Column Range
- Extract the Number Preceding Specific Text in a String
- Extract Duplicates once, which are Common in 2 Columns
- Count Continuous Non-Blank cells which appear Last
- SUM Cell values containing any of the Multiple Values in Full or in Part
- Calculate End Date (& Time) from Start Date (& Time) and Duration (Work Hours) in Excel
- Extract a Sorted List of Unique values in a column
- Excel Functions
- Excel Text and String Functions: TRIM & CLEAN
- ASCII Code, Extended ASCII characters (8-bit system) and ANSI Code.
- Excel CODE & CHAR Functions, VBA Asc & Chr Functions
- Excel Text and String Functions: LEFT, RIGHT, MID, LEN, FIND, SEARCH, REPLACE, SUBSTITUTE
- CHOOSE Function in Excel
- Excel IF Function and IF Statements
- Excel VLOOKUP Function
- Excel OFFSET Function
- Excel INDIRECT Function
- Excel SUMPRODUCT Function
- Excel Pivot Tables
- Printing a Pivot Table Report – Excel
- Create a Pivot Chart in Excel – graphical display of a Pivot Table
- Excel Pivot Table Design & Layout, Pivot Table Styles
- Excel Pivot Table Report – Sort Data in Row & Column Labels & in Values Area, use Custom Lists
- Excel Pivot Tables: Filter Data, Items, Values & Dates
- Excel Pivot Tables: Insert Calculated Fields & Calculated Items, Create Formulas
- Excel Pivot Table Report – Summary Functions & Custom Calculations, Insert Calculated Fields or Calculated Items
- Excel Pivot Table Report – Group Items, Group Date and Time Values
- Excel Pivot Table Report – Field Settings, Expand or Collapse Fields & Items, Refresh Data, Change Data Source & Show or Hide options
- Excel Pivot Table Report – Clear All, Remove Filters, Select Mutliple Cells or Items, Move a Pivot Table
- Excel Tips
- Case Sensitive Vlookup in Excel; Finding the 1st, 2nd, nth or last occurrence of the Lookup Value
- Vlookup Multiple Values – Return MULTIPLE corresponding values for ONE Lookup Value
- Excel Date and Time Functions and Formulas
- Find ‘Smallest’, ‘Largest’, ‘K-th Smallest’ and ‘K-th Largest’ Numbers in a Range
- Remove Duplicates in a range, using “Remove duplicates” button in Data Tools
- Remove Duplicates or Create a List of Unique Records using Excel Formula
- Remove Duplicates or Create a List of Unique Records using Advanced Data Filter
- Count Number of Unique Values in a Range (with Excel Functions)
- Shade Alternate Rows – Conditional Formatting
- Left Lookup with Vlookup Excel Function
- Excel VBA
- Excel VBA: ActiveX Controls, Form Controls & AutoShapes on a Worksheet
- ChartFormat object – line, fill & effect formatting for chart elements: FillFormat object, LineFormat object, ShadowFormat object, GlowFormat object, SoftEdgeFormat object, ThreeDFormat object
- Child Objects common for many chart elements: Border Object, ChartFillFormat Object, Interior Object, Font Object
- Chart Elements in Excel VBA (Part 2) – Chart Series, Data Labels, Chart Legend
- Chart Elements in Excel VBA (Part 1) – Chart Title, Chart Area, Plot Area, Chart Axes
- Charts in Excel VBA – Add a Chart, the Chart object & the ChartObject object
- Create Charts in Excel VBA: Embedded Charts – Line with Markers; Clustered Stacked Column Chart; Clustered Stacked Bar Chart displaying Variance; Pie chart; XY Scatter chart & Bubble chart
- Excel VBA Debugging Tools in Visual Basic Editor – Breakpoints & Break Mode, Stepping Through Code, Debugging Views
- Excel VBA Errors & Error Handling, On Error & Resume Satements, Exit Statement, Err Object
- Excel VBA Date & Time Functions; Year, Month, Week & Day Functions
- ExcelAnytime Site
- My Account
- Website Use Policy
- Excel VBA Online Tutorial
- Testimonials GlobaliConnect.com
- About ExcelAnytime.com
- Excel VBA Online Tutorial – learn Excel VBA programming & access examples, illustrations, live codes and downloadable files
- Excel and VBA Services
- Sample Data-Articles
- test
- Sample Sites
- Search
- News Flash
- Koala
- The Joomla! Community
- System
- Related Items Module
- Phyllopteryx
- The Joomla! Project
- Fruit Shop SiteGrowersJoomla!
- The Joomla! Project
- User
- Random Image Module
- Upgraders
- Content
- Weblinks Module
- Using Joomla!
- Archive Module
- Language Switcher
- Administrator Components
- Authentication
- Latest Users Module
- Editors
- Banner Module
- Editors-xtd
- Custom HTML Module
- Search
- Feed Display
- System
- Footer Module
- Who’s Online
- Latest Users Module
- Banner Module
- Custom HTML Module
- Feed Display
- Footer Module
- Random Image Module
- Weblinks Module
- Archive Module
- Language Switcher
- News Flash
- Related Items Module
- Archive Module
- Article Categories Module
- Articles Category Module
- Latest Articles Module
- Most Read Content
- Pinnacles
- Blue Mountain Rain Forest
- Ormiston Pound
- Australian Parks
- First Blog Post
- Second Blog Post
- Koala
- Phyllopteryx
- Spotted Quoll
- Wobbegone
- Koala
- Phyllopteryx
- Spotted Quoll
- Wobbegone
- Cradle Mountain
- Pinnacles
- Blue Mountain Rain Forest
- Ormiston Pound
- VBATutorial - Cond Stmnts
