Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
multiple CHR() in VBA
Good morning to all.
I have made a macro that works pretty well with one exception so far. I have a sumproduct equation that doesn't accept certain characters in VBA. I've tried a variety of ways to use chr() in line, but I keep getting various errors. I've used the three following variations. &chr(n)& &chr(n_a)& &chr(n_b)& 'this one returns a 1004 error. &chr(n) & chr(n_a) & chr(n_b) & ' this one returns a missing & error. & chr(n), & chr(n_a), & chr(n_b) & 'this one returns a 1004 error. I think it's the commas. where n, n_a, and n_b are different numeric values for their respective characters. What I'd like to do is the following. ActiveCell.FormulaR1C1= "=sumproduct((WkshtNm!$Col$RwRngA&""=$ColRw&"")*(W kshtNm!$Col$RwRngB=$ColRw)*(WkshtNm!$col$RwRngC))" At first the only problem I had was the two dbl quotes. I replaced them with chr(34). I then found that the ampersand symbol was not accepted and drew another error response. So I tried replacing that with a chr(38), but then I found that it would not take three characters in a row, together. Or perhaps I should say that it did not accept it the way I did it-- shown above. 1- can I use multiple chr() in line, together? 2- if so, how? 3- if not, any ideas on how to do this so it would work? Thank you. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete Blank Rows Code - Multiple Worksheets - Multiple Documents | Excel Discussion (Misc queries) | |||
macro: copy multiple workbooks to multiple tabs in single book | Excel Programming | |||
Crteating Multiple GIFS from Multiple Ranges -- need someone to test my code to see why it fails | Excel Programming | |||
Crteating Multiple GIFS from Multiple Ranges -- need someone to test my code to see why it fails | Excel Programming | |||
view multiple files in multiple windows on multiple screens. | Excel Discussion (Misc queries) |