 |
| Excel VBA Discuss using VBA for Excel programming. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

October 16th, 2003, 10:29 AM
|
|
Registered User
|
|
Join Date: Oct 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Excel Formula
I understand that this is not really VBA, but maybe you could help any way. I Have downloaded data from my manufacturing system in a tab-delimited format. I import into excel and some of the data in some of the formulas have " around my text. What formula can I write to detect whether there is a " at the begining or end of my column and if there is, delete the mark. Bear in mind that the data is different lengths.
Thanks
|
|

October 16th, 2003, 03:35 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
If you would use vba you could run this one. This checks column A [Range("A65...]:
Sub RemQuot()
Dim i, o As Integer
Range("A65536").End(xlUp).Select
i = ActiveCell.Row
For o = 1 To i
If Right(Cells(o, 1), 1) = """" Then Cells(o, 1) = Left(Cells(o, 1), Len(Cells(o, 1)) - 1)
If Left(Cells(o, 1), 1) = """" Then Cells(o, 1) = Right(Cells(o, 1), Len(Cells(o, 1)) - 1)
Next o
End Sub
Formulas, which isn't my speciality, you could try these 2:
=IF(RIGHT(A1)="""";REPLACE(A1;LEN(A1);1;""))
=IF(LEFT(A1)="""";REPLACE(A1;1;1;""))
But you,ll have to find out yourself how to make them run concatenated, if possible.
|
|

October 30th, 2003, 11:35 PM
|
|
Authorized User
|
|
Join Date: Oct 2003
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
This formula also works. It will "remove" quotes from text in cell A1, if it has them.
=IF(LEFT(A1)="""",MID(A1,2,LEN(A1)-2),A1)
|
|

September 22nd, 2004, 10:32 PM
|
|
Registered User
|
|
Join Date: Sep 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
You can try the Replace feature. Highlight the field containing the " sign and click ctrl+H. The first box will say "Find what:" and the second box will say "Replace with:". Under "Find what:", type ". If there are spaces between the " sign and the next word, you can add the spaces as well. Under "Replace with:", you don't put anything. Leave it empty. The Replace feature will eliminate the " sign and if there are spaces, the spaces will be eliminated as well.
Goodluck
Quote:
quote:Originally posted by zachtom
I understand that this is not really VBA, but maybe you could help any way.Ã Ã I Have downloaded data from my manufacturing system in a tab-delimited format.Ã Ã I import into excel and some of the data in some of the formulas have " around my text.Ã Ã What formula can I write to detect whether there is a " at the begining or end of my column and if there is, delete the mark.Ã Ã Bear in mind that the data is different lengths.
Thanks
|
|
|

May 6th, 2006, 08:02 PM
|
|
Registered User
|
|
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Any idea on how to make this work on multi line strings.
E.g.
=CONCATENATE("Hello World",CHAR(10))
=IF(LEFT(A1)="""",MID(A1,2,LEN(A1)-2),A1)
The second does not sense the quote but when we copy A1 or A2 and paste it to a file then it contains a quote.
|
|
 |