Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Entering quote marks in SUMIF function

Hi,
I'm trying to enter a variable as the criteria for the sumif function
from my macro. I can't seem to get the criteria in quote marks...

Cells(ActiveSheet.UsedRange.Rows.Count,
Range("Amount").Column).FormulaR1C1 = "=SUMIF(C[-10],"" & i & "",C)"
enters the formula as =SUMIF(B:B," & i & ",L:L), and

Cells(ActiveSheet.UsedRange.Rows.Count,
Range("Amount").Column).FormulaR1C1 = "=SUMIF(C[-10]," & i & ",C)"
enters the formula as SUMIF(B:B,ABC123,L:L).

I need SUMIF(B:B,"ABC123",L:L).

Can someone help please?
I've ran out of logical soultions..

Tony

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Entering quote marks in SUMIF function

Tony,

try it like this:

Range("Amount").Column).FormulaR1C1 = "=SUMIF(C[-10],""" & i & """,C)"


--
Hope that helps.

Vergel Adriano


"bony_tony" wrote:

Hi,
I'm trying to enter a variable as the criteria for the sumif function
from my macro. I can't seem to get the criteria in quote marks...

Cells(ActiveSheet.UsedRange.Rows.Count,
Range("Amount").Column).FormulaR1C1 = "=SUMIF(C[-10],"" & i & "",C)"
enters the formula as =SUMIF(B:B," & i & ",L:L), and

Cells(ActiveSheet.UsedRange.Rows.Count,
Range("Amount").Column).FormulaR1C1 = "=SUMIF(C[-10]," & i & ",C)"
enters the formula as SUMIF(B:B,ABC123,L:L).

I need SUMIF(B:B,"ABC123",L:L).

Can someone help please?
I've ran out of logical soultions..

Tony


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Entering quote marks in SUMIF function

Well that was simple
Why 3 " ?
Doesn't seem to make sense to me
Wouldn't the second " in the group of 3 close the string? Why is there
3rd one?

T

On May 4, 11:19 am, Vergel Adriano
wrote:
Tony,

try it like this:

Range("Amount").Column).FormulaR1C1 = "=SUMIF(C[-10],""" & i & """,C)"

--
Hope that helps.

Vergel Adriano



"bony_tony" wrote:
Hi,
I'm trying to enter a variable as the criteria for the sumif function
from my macro. I can't seem to get the criteria in quote marks...


Cells(ActiveSheet.UsedRange.Rows.Count,
Range("Amount").Column).FormulaR1C1 = "=SUMIF(C[-10],"" & i & "",C)"
enters the formula as =SUMIF(B:B," & i & ",L:L), and


Cells(ActiveSheet.UsedRange.Rows.Count,
Range("Amount").Column).FormulaR1C1 = "=SUMIF(C[-10]," & i & ",C)"
enters the formula as SUMIF(B:B,ABC123,L:L).


I need SUMIF(B:B,"ABC123",L:L).


Can someone help please?
I've ran out of logical soultions..


Tony- Hide quoted text -


- Show quoted text -



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
How to I use nested quotation marks for 'SUMIF' function in Excel. Glenn Excel Programming 3 January 3rd 17 07:31 AM
Quote Marks Through VBA [email protected] Excel Discussion (Misc queries) 12 November 16th 06 05:20 PM
How to keep quote marks for CSV in excel Matt Excel Discussion (Misc queries) 0 August 1st 06 12:30 AM
SUMIF function in "Price quote with tax calculation" templae Peter Excel Worksheet Functions 6 October 3rd 05 07:18 PM
How do you look for quote marks? ExcelMonkey Excel Programming 3 July 19th 05 12:02 PM


All times are GMT +1. The time now is 02:28 PM.

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

About Us

"It's about Microsoft Excel"