Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

STL - Formerly Best Training Solutions Through Learning
TrustPilot
Excellent
Request Callback We will call you back
0207 987 3777 Call for assistance
Your Basket Basket is empty
macros

ResolvedVersion 2007

David has attended:
Excel Intermediate course
Excel Advanced course
Access Intermediate course
Access Advanced course

Macros

Macro for changing a range of cells from lower case to upper case. The same keyboard shortcut as the toggle as 'shift + F3' in Word

RE: Macros

David - try this

Create the macro:

Sub MyChangeCase
for each GetCell in selection
GetCell.value = ucase(GetCell.value)
next GetCell
end sub

Select the cells on the spreadsheet and then run the macro

RE: Macros

Hi David

Thank You for your question

The following code will solve the problem for you. Simply create a module in the VBE and paste the code into it

Sub UcaseFormatter()


Dim varRange As Range
Dim intRowCount As Integer
Dim intColCount As Integer


Set varRange = Range("A1").CurrentRegion

For intRowCount = 1 To varRange.Rows.Count

For intColCount = 1 To varRange.Columns.Count

Range("a1").Cells(intRowCount, intColCount).Value = UCase(Range("a1").Cells(intRowCount, intColCount).Value)

Next intColCount

Next intRowCount

End Sub


In this example the range of cells in question must start at cell "A1"

Regards

Stephen

Excel tip:

Hide separate columns in Excel 2010

If you want to hide columns not adjacent to each other for example, Columns A, C and E then:-

1) Click on the fist column to be hidden i.e. A

2) Press and hold down the CTRL key

3) While holding the CTRL key, left click on the rest of the columns you want to hide i.e. C and E

4) Right click and choose Hide

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.