This block works as is, it changes the targeted cells to Text and adds a double quote to the end.
However- I wish to remove the double quote from the end.
1 1/2 is the value evaluated, it has a cell fractional format. The first block of code changes it to 1 1/2" and the cell format is now Text.
I wish to change it to 1 1/2 only and the cell format to Text. If I remove the two double quotes from the end, my results end up w/ a #Value!
This code is supposed to only evalueate cells in col. M w/ a value greater than zero, it is evaluating all cells, and if the cell is blank, it is returning a zero (0) value in col M.
Returns value w/ " on the end
[VBA]For i = 4 To LRowf
If Cells(i, "G").Text = "HWBLTS" Or Cells(i, "G").Text = "HWRISR" _
And IsNumeric(Cells(i, "M").Value) > 0 Then
Cells(i, "M").Value = Application.Text(Cells(i, "M").Value, "# ##/##\""")
End If
Next i[/VBA]
Returns #Value! error
[VBA]For i = 4 To LRowf
If Cells(i, "G").Text = "HWBLTS" Or Cells(i, "G").Text = "HWRISR" _
And IsNumeric(Cells(i, "M").Value) > 0 Then
Cells(i, "M").Value = Application.Text(Cells(i, "M").Value, "# ##/##\")
End If
Next i[/VBA]
A thought I have is instead of using this line:
And IsNumeric(Cells(i, "M").Value) > 0 Then
can a Length function be added to it, so it would be IsNumeric and Length is > 0
Syntax would be
And IsNumeric(Len(Cells(i, "M").Value)) > 0 Then