Wrox Programmer Forums
|
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
 
Old October 16th, 2003, 10:29 AM
Registered User
 
Join Date: Oct 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

 
Old October 16th, 2003, 03:35 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
 
Old October 30th, 2003, 11:35 PM
Authorized User
 
Join Date: Oct 2003
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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)



 
Old September 22nd, 2004, 10:32 PM
Registered User
 
Join Date: Sep 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old May 6th, 2006, 08:02 PM
Registered User
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Putting Formula in Excel Sheet ritesh2381 ASP.NET 1.0 and 1.1 Basics 0 March 26th, 2008 05:59 AM
Excel to Javascript formula assistance recei Javascript How-To 1 February 6th, 2007 10:25 AM
Formula in Excel davekrunal46 Excel VBA 1 December 5th, 2005 06:51 AM
converting formula in excel ct Excel VBA 0 October 5th, 2005 10:06 PM
What does it means in a EXCEL formula?! aarias Excel VBA 1 October 2nd, 2003 02:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.