Pivot tables changes the case

K

Katherine

Hi, I have a macro that creates a pivot table from a set of data on a separate sheet in Excel. My problem is that during the pivot the case on the header _sometimes_ gets changed. For example the data is 'EX-Examination' but in the pivot table this is shown as 'EX-examination' .

This then means that my later macros can't then match up the 2 pieces of data. Any ideas how to stop this happening?
 
B

Bob Flanagan

Katherine, most likely the first occurence of the phase is the non-capital
occurence.

The simpliest solution is to put

Option Compare Text

at the top of your modules. This makes string comparisions case
insensitive.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel

Katherine said:
Hi, I have a macro that creates a pivot table from a set of data on a
separate sheet in Excel. My problem is that during the pivot the case on the
header _sometimes_ gets changed. For example the data is 'EX-Examination'
but in the pivot table this is shown as 'EX-examination' .
This then means that my later macros can't then match up the 2 pieces of
data. Any ideas how to stop this happening?
 
Top