WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Excel
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Excel Proper Case


Question:

Another one for the XL Gurus. I have a csv file with a number of text items in each record. The Case is a mixture and I want to be able to load it into XL and have it appear as Proper Case. Don't however really want to load an additional column with the Proper Case formula and then copy that column back over the original(values only). Is there an alternative ?

Answer:

You could let Excel do all the work (assuming the CSV is loaded and oWS is the current active worksheet with the data)
xlConstants=2
xlTextValues=2
xlCalculationAutomatic=-4105
xlCalculationManual=-4135
oXL.Calculation = xlCalculationManual
oXL.ScreenUpdating = @FALSE 
ForEach c In oWS.Cells.SpecialCells(xlConstants, xlTextValues)
c.Value = oXL.WorksheetFunction.Proper(c.Value)
Next
oXL.Calculation = xlCalculationAutomatic
oXL.ScreenUpdating = @True

Article ID:   W16614
File Created: 2005:02:18:12:21:38
Last Updated: 2005:02:18:12:21:38