ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   #NAME? Error Fix? (https://www.excelbanter.com/excel-programming/316991-name-error-fix.html)

Martin Just

#NAME? Error Fix?
 
Hi all. I'm importing a bunch of data from a .csv file. The host
application is not able to delimit the Customer Name field correctly, so for
some record types, I get values that look like:

=-- John Smith

Excel interprets this as a bad formula and returns #NAME? in the cell. I'm
trying to remove the leading characters using

If Left(ActiveCell.Value, 1) = "=" Then
ActiveCell.Value = Right(ActiveCell.Value,
Len(ActiveCell.Value) - 5)
End If

but get a Type Mismatch error. Any ideas how to tell Excel they are not
formulas?

Thanks much!



Don Guillett[_4_]

#NAME? Error Fix?
 
Let us know if this works.

Sub cleanitup()
For Each c In Selection
x = c.Formula
If c.HasFormula Then c.Value = Right(x, Len(x) - 4)
Next
End Sub

--
Don Guillett
SalesAid Software

"Martin Just" wrote in message
...
Hi all. I'm importing a bunch of data from a .csv file. The host
application is not able to delimit the Customer Name field correctly, so

for
some record types, I get values that look like:

=-- John Smith

Excel interprets this as a bad formula and returns #NAME? in the cell. I'm
trying to remove the leading characters using

If Left(ActiveCell.Value, 1) = "=" Then
ActiveCell.Value = Right(ActiveCell.Value,
Len(ActiveCell.Value) - 5)
End If

but get a Type Mismatch error. Any ideas how to tell Excel they are not
formulas?

Thanks much!





Martin Just

#NAME? Error Fix?
 
Perfect! Thanks so much!




"Don Guillett" wrote in message
...
Let us know if this works.

Sub cleanitup()
For Each c In Selection
x = c.Formula
If c.HasFormula Then c.Value = Right(x, Len(x) - 4)
Next
End Sub

--
Don Guillett
SalesAid Software

"Martin Just" wrote in message
...
Hi all. I'm importing a bunch of data from a .csv file. The host
application is not able to delimit the Customer Name field correctly, so

for
some record types, I get values that look like:

=-- John Smith

Excel interprets this as a bad formula and returns #NAME? in the cell.

I'm
trying to remove the leading characters using

If Left(ActiveCell.Value, 1) = "=" Then
ActiveCell.Value = Right(ActiveCell.Value,
Len(ActiveCell.Value) - 5)
End If

but get a Type Mismatch error. Any ideas how to tell Excel they are not
formulas?

Thanks much!







Don Guillett[_4_]

#NAME? Error Fix?
 
Glad to help

--
Don Guillett
SalesAid Software

"Martin Just" wrote in message
...
Perfect! Thanks so much!




"Don Guillett" wrote in message
...
Let us know if this works.

Sub cleanitup()
For Each c In Selection
x = c.Formula
If c.HasFormula Then c.Value = Right(x, Len(x) - 4)
Next
End Sub

--
Don Guillett
SalesAid Software

"Martin Just" wrote in message
...
Hi all. I'm importing a bunch of data from a .csv file. The host
application is not able to delimit the Customer Name field correctly,

so
for
some record types, I get values that look like:

=-- John Smith

Excel interprets this as a bad formula and returns #NAME? in the cell.

I'm
trying to remove the leading characters using

If Left(ActiveCell.Value, 1) = "=" Then
ActiveCell.Value = Right(ActiveCell.Value,
Len(ActiveCell.Value) - 5)
End If

but get a Type Mismatch error. Any ideas how to tell Excel they are

not
formulas?

Thanks much!










All times are GMT +1. The time now is 03:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com