Einstein47
Programmer
I am working on a macro that takes input values and compares various columns to a defined translation table to get the output value. The translation table is user defined. One of the input/output values is being automatically converted to a date when it is encountered.
This is the [red]input[/red],[blue]output[/blue] value:
[red]Bicarbonate (As CaCO3)[/red], [blue] 10-13-9[/blue]
How can I keep Excel from converting "10-13-9" to a date? I need to keep it as text.
I have tried putting a single quote (') before the output value, but that doesn't help. This is the line in the macro VBA code that reads the translation table.
Where: Analyte="Bicarbonate (As CaCO3)"
And: TempStr="10-13-9"
Any help is greatly appreciated.
Einstein47
“Evil abounds when good men do nothing.“ - Nelson R.
[[]Starbase47.com]
This is the [red]input[/red],[blue]output[/blue] value:
[red]Bicarbonate (As CaCO3)[/red], [blue] 10-13-9[/blue]
How can I keep Excel from converting "10-13-9" to a date? I need to keep it as text.
I have tried putting a single quote (') before the output value, but that doesn't help. This is the line in the macro VBA code that reads the translation table.
Code:
If CAS = "" Then
TempStr = Application.WorksheetFunction.VLookup(Analyte, Sheets("Defs").Range("CASrange"), 2, False)
Cells(curRow, 13).Value = TempStr
Else
Cells(curRow, 13).Value = CAS
End If
And: TempStr="10-13-9"
Any help is greatly appreciated.
Einstein47
“Evil abounds when good men do nothing.“ - Nelson R.
[[]Starbase47.com]