Hi
I am struggling with an exported Excel sheet that is used to allow suppliers to enter information that is then uploaded back into my db app. The problem is with one field in Column H.
In Access it is a text format in that it contains a 7 digit number where the first digit may be a zero. This exports into the spreadsheet fine, but ...
If the supplier needs to change this code and the new code starts with a leading zero then Excel chops off that leading zero and so gives me a false code.
What I need to do programatically is to set the format for the cells in column H specifically to text.
I have tried rather optimistically (but it doesn't like it - so I have commented it out)
I have not included the preceeding and following code for the sake of simplicity.
I have tried searching the forum and also google to see if I can get the right key words/syntax but to no avail. I have tried a number of variants but none seem to work.
Can anyone help me on this one?
Thanks in anticipation
Best wishes
I am struggling with an exported Excel sheet that is used to allow suppliers to enter information that is then uploaded back into my db app. The problem is with one field in Column H.
In Access it is a text format in that it contains a 7 digit number where the first digit may be a zero. This exports into the spreadsheet fine, but ...
If the supplier needs to change this code and the new code starts with a leading zero then Excel chops off that leading zero and so gives me a false code.
What I need to do programatically is to set the format for the cells in column H specifically to text.
I have tried rather optimistically (but it doesn't like it - so I have commented it out)
Code:
' Set the background to yellow for columns G & H
oSheet.Columns("G:H").Interior.ColorIndex = 6
oSheet.Columns("A:D").Interior.ColorIndex = 15
' Set the cell format to text for Column H
' oSheet.Columns("H").Format.Text
I have tried searching the forum and also google to see if I can get the right key words/syntax but to no avail. I have tried a number of variants but none seem to work.
Can anyone help me on this one?
Thanks in anticipation
Best wishes