ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I use quotes in an IF statement? (https://www.excelbanter.com/excel-programming/338995-how-do-i-use-quotes-if-statement.html)

panuvin[_2_]

How do I use quotes in an IF statement?
 

I'm trying to weed out some data out of an excel spreadsheet with lik
8000 rows. The problem I'm having is that Peoplesoft enters doubl
quotes for each cell and I'm not sure what the escape character (i
that's the solution) for VBA is. For example, I have the followin
if-then


Code
-------------------

Sub deleteMary()
Dim i As Integer

For i = 2 To 3886
If Cells(i, "D") = "Chase, Mary A" Then
Rows("D").Delete
End If
Next

End Sub

-------------------


The problem is that this particular name already has quotes in the cel
and I can't use ""Chase, Mary A"" in the If-expression. How can I solv
this problem?

Thanks!

Panuvi

--
panuvi
-----------------------------------------------------------------------
panuvin's Profile: http://www.excelforum.com/member.php...fo&userid=2381
View this thread: http://www.excelforum.com/showthread.php?threadid=40132


Bob Phillips[_6_]

How do I use quotes in an IF statement?
 
If Cells(i, "D") = """Chase Mary""" Then

--

HTH

RP
(remove nothere from the email address if mailing direct)


"panuvin" wrote in
message ...

I'm trying to weed out some data out of an excel spreadsheet with like
8000 rows. The problem I'm having is that Peoplesoft enters double
quotes for each cell and I'm not sure what the escape character (if
that's the solution) for VBA is. For example, I have the following
if-then


Code:
--------------------

Sub deleteMary()
Dim i As Integer

For i = 2 To 3886
If Cells(i, "D") = "Chase, Mary A" Then
Rows("D").Delete
End If
Next

End Sub

--------------------


The problem is that this particular name already has quotes in the cell
and I can't use ""Chase, Mary A"" in the If-expression. How can I solve
this problem?

Thanks!

Panuvin


--
panuvin
------------------------------------------------------------------------
panuvin's Profile:

http://www.excelforum.com/member.php...o&userid=23818
View this thread: http://www.excelforum.com/showthread...hreadid=401320




Mike Fogleman

How do I use quotes in an IF statement?
 
Rows( i ).Delete

"D" would be a column

Mike F

"Bob Phillips" wrote in message
...
If Cells(i, "D") = """Chase Mary""" Then

--

HTH

RP
(remove nothere from the email address if mailing direct)


"panuvin" wrote in
message ...

I'm trying to weed out some data out of an excel spreadsheet with like
8000 rows. The problem I'm having is that Peoplesoft enters double
quotes for each cell and I'm not sure what the escape character (if
that's the solution) for VBA is. For example, I have the following
if-then


Code:
--------------------

Sub deleteMary()
Dim i As Integer

For i = 2 To 3886
If Cells(i, "D") = "Chase, Mary A" Then
Rows("D").Delete
End If
Next

End Sub

--------------------


The problem is that this particular name already has quotes in the cell
and I can't use ""Chase, Mary A"" in the If-expression. How can I solve
this problem?

Thanks!

Panuvin


--
panuvin
------------------------------------------------------------------------
panuvin's Profile:

http://www.excelforum.com/member.php...o&userid=23818
View this thread:
http://www.excelforum.com/showthread...hreadid=401320






Bob Phillips[_6_]

How do I use quotes in an IF statement?
 
Didn't even spot that <g concentrating on the quotes.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mike Fogleman" wrote in message
...
Rows( i ).Delete

"D" would be a column

Mike F

"Bob Phillips" wrote in message
...
If Cells(i, "D") = """Chase Mary""" Then

--

HTH

RP
(remove nothere from the email address if mailing direct)


"panuvin" wrote

in
message ...

I'm trying to weed out some data out of an excel spreadsheet with like
8000 rows. The problem I'm having is that Peoplesoft enters double
quotes for each cell and I'm not sure what the escape character (if
that's the solution) for VBA is. For example, I have the following
if-then


Code:
--------------------

Sub deleteMary()
Dim i As Integer

For i = 2 To 3886
If Cells(i, "D") = "Chase, Mary A" Then
Rows("D").Delete
End If
Next

End Sub

--------------------


The problem is that this particular name already has quotes in the cell
and I can't use ""Chase, Mary A"" in the If-expression. How can I

solve
this problem?

Thanks!

Panuvin


--
panuvin


------------------------------------------------------------------------
panuvin's Profile:

http://www.excelforum.com/member.php...o&userid=23818
View this thread:
http://www.excelforum.com/showthread...hreadid=401320









All times are GMT +1. The time now is 06:44 PM.

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