Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Passing string arguments that have quotation marks in them

Hi.

I have a function that builds and evaluates an array formula SUM(IF based on
a number of arguments. Some of these arguments are string values that may
have "" within them.

For example, I might have an item number description (one of the arguments)
that looks like this: "Left side "H" Bracket".

The function works fine for every item except items with this type of
description. I'd like to avoid requiring users to remove the "" in the
description if possible.

Can anyone help me out?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Passing string arguments that have quotation marks in them

Guess you need to modify your code to account for the possible existence of
embedded double quotes.

without seeing your code, there isn't much else that can be said.

--
Regards,
Tom Ogilvy

"Caro-Kann Defence" wrote in
message ...
Hi.

I have a function that builds and evaluates an array formula SUM(IF based

on
a number of arguments. Some of these arguments are string values that may
have "" within them.

For example, I might have an item number description (one of the

arguments)
that looks like this: "Left side "H" Bracket".

The function works fine for every item except items with this type of
description. I'd like to avoid requiring users to remove the "" in the
description if possible.

Can anyone help me out?

Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Passing string arguments that have quotation marks in them

Thanks Tom.

Does this help?

Dim eRow As Integer
Dim platRng As Range, pldcRng As Range, partRng As Range, prd1Rng As Range
Dim prd2Rng As Range, colmRng As Range
Dim dBook As Workbook
Dim dShet As Worksheet
Dim eString As String, cString As String

Function Results(xShet As String, xCol As Integer, xPlat As Variant, xPlDc
As Variant, _
xPart As Variant, Optional xPrD1 As Variant = "", Optional xPrD2 As
Variant = "") As Double

'Pulls the corresponding value for the unique combination of Platform,
Platform description, Part, Part description 1, and Part description 2

Set dBook = ActiveWorkbook
Set dShet = dBook.Worksheets(xShet)

eRow = dShet.Cells(65536, 1).End(xlUp).Row

On Error Resume Next

If eRow 1 Then
Set colmRng = Range(dShet.Cells(2, xCol).Resize(eRow - 1, 1).Address)
Set platRng = Range(dShet.Cells(2, 7).Resize(eRow - 1, 1).Address)
Set pldcRng = Range(dShet.Cells(2, 8).Resize(eRow - 1, 1).Address)
Set partRng = Range(dShet.Cells(2, 9).Resize(eRow - 1, 1).Address)
Set prd1Rng = Range(dShet.Cells(2, 10).Resize(eRow - 1, 1).Address)
Set prd2Rng = Range(dShet.Cells(2, 11).Resize(eRow - 1, 1).Address)

eString = "=SUM(IF(('" & dShet.Name & "'!" & platRng.Address & "=""" &
xPlat & """)*('" & dShet.Name & "'!" & pldcRng.Address & _
"=""" & xPlDc & """)*('" & dShet.Name & "'!" & partRng.Address &
"=""" & xPart & """)*('" & dShet.Name & "'!" & prd1Rng.Address & _
"=""" & xPrD1 & """)*('" & dShet.Name & "'!" & prd2Rng.Address &
"=""" & xPrD2 & """),'" & dShet.Name & "'!" & colmRng.Address & ",0))"
Results = Evaluate(eString)
End If

On Error GoTo 0

End Function


"Tom Ogilvy" wrote:

Guess you need to modify your code to account for the possible existence of
embedded double quotes.

without seeing your code, there isn't much else that can be said.

--
Regards,
Tom Ogilvy

"Caro-Kann Defence" wrote in
message ...
Hi.

I have a function that builds and evaluates an array formula SUM(IF based

on
a number of arguments. Some of these arguments are string values that may
have "" within them.

For example, I might have an item number description (one of the

arguments)
that looks like this: "Left side "H" Bracket".

The function works fine for every item except items with this type of
description. I'd like to avoid requiring users to remove the "" in the
description if possible.

Can anyone help me out?

Thanks!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Quotation Marks 9pluck9 Excel Discussion (Misc queries) 2 May 2nd 07 04:40 PM
Quotation Marks? LinearChaos Excel Worksheet Functions 2 June 25th 06 10:31 PM
Quotation Marks - When and What?? heski Excel Discussion (Misc queries) 2 February 7th 06 12:40 PM
quotation marks JohnF Excel Worksheet Functions 7 February 5th 06 09:33 PM
Using quotation marks Mike Collard Excel Programming 4 July 20th 04 08:09 PM


All times are GMT +1. The time now is 05:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"