VBA TO CONVERT TEXT TO UPPERCASE

egris52788

Board Regular
Joined
Mar 6, 2003
Messages
114
i need a macro that will change an entire sheet to uppercase. we are not allowed to download utilities, therefore I cant use asap utilities, i need to put the code directly into my workbook. thanks
 
I don't follow the Sub DriverName_Change()
It
- Declares DriveName as String,
- Doesn't assign any value to that variable (so it will be an empty string)
- Converts to upper case (but there was nothing to convert)
- Tries to Return somewhere (but where?)

However, in the main procedure, assuming that it works (that is, does not error) are you saying that making the following change causes that error to occur?
Rich (BB code):
Do
DriverName = InputBox("What is the name of the Driver you are adding?")

<del>DriverName = Application.WorksheetFunction.Proper(DriverName)</del>
DriverName = UCase(DriverName)

AddDriverStart:
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Sorry for the confusion! The line DriverName = Application.WorksheetFunction.Proper(DriverName) was substituted with Call but I took it out when it didn't work and reverted to the 'Proper' line.

Unfortunately DriverName=UCase(DriverName) does not work returning the error Can't find project or library.
 
Upvote 0
That did it! Many thanks Peter

The line should read DriverName = VBA.Ucase(DriverName)

Hope this helps others.

Again many thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,214,608
Messages
6,120,500
Members
448,968
Latest member
screechyboy79

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top