macros

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

TrustPilot

starstarstarstarstar Excellent

  • Home
  • Courses
  • Promotions
  • Schedule
  • Formats
  • Our Clients

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Macros

Macros

resolvedResolved · Low Priority · Version 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:

Shortcut for deleting all comments in a spreadsheet

If you have entered multiple comments into a spreadsheet and wish to delete them all at once, you can achieve this by:

1. Holding down Ctrl, then Shift, then O - this will select all cells containing comments in the worksheet you are looking at.

2. Right-clicking on one of the selected cells, and selecting Delete Comment from the menu that appears.

3. Clicking anywhere else in the spreadsheet to deselect comments - all comments should have disappeared from the spreadsheet.

View all Excel hints and tips


Server loaded in 0.08 secs.