Doug Williams
New Member
- Joined
- Jul 12, 2009
- Messages
- 1
Hi guys,
I work with Excel to process and correct data files and I have developed a macro to reduce the work load in this area.
I have found that using macros don't always replicate the actions performed using the manual controls in Excel. Doing a 'find and replace' on "-" to "/" on a cell containing the date "12-06-09" will give the correct Australian date of "12/06/09" from the manual controls. When running the equivilent find a replace function in a Macro, Excel AutoFormats the data into US format "06/12/09".
A similar issue occurs when you use the save fuction in a Macro. US dates are applied. Saving a file manually leaves the dates in the correct Australian format.
Why does this happen?
Is there anyway to prevent the AutoFormat process from happing in the code?
Are there any options to setup the AutoFormat date to Australian?
Another related question. Is there anyway to prevent Auto Formatting when opening CSV files? Mobile phone numbers start with a "0" and excel thinks the cell should be a number. This is not the case and as a result it corrupts the file. I have used the import function of excel (I set columns to text manually in the import process) to combat this, but it is very time consuming.
I work with Excel to process and correct data files and I have developed a macro to reduce the work load in this area.
I have found that using macros don't always replicate the actions performed using the manual controls in Excel. Doing a 'find and replace' on "-" to "/" on a cell containing the date "12-06-09" will give the correct Australian date of "12/06/09" from the manual controls. When running the equivilent find a replace function in a Macro, Excel AutoFormats the data into US format "06/12/09".
A similar issue occurs when you use the save fuction in a Macro. US dates are applied. Saving a file manually leaves the dates in the correct Australian format.
Why does this happen?
Is there anyway to prevent the AutoFormat process from happing in the code?
Are there any options to setup the AutoFormat date to Australian?
Another related question. Is there anyway to prevent Auto Formatting when opening CSV files? Mobile phone numbers start with a "0" and excel thinks the cell should be a number. This is not the case and as a result it corrupts the file. I have used the import function of excel (I set columns to text manually in the import process) to combat this, but it is very time consuming.