Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using the following
ActiveCell.FormulaR1C1 = "=CONCATENATE(PriorYear&" - "&PriorMonth&": "&VLOOKUP(RC[-26],'Prior Month'!R9C1:R1009C12,12,FALSE),CHAR(10),'Prior Month'!RC[-17])" to pull in prior month commentary and adding a date stamp with a COLON between the two. The above should look like: 2007-08: This situation... The colon in not being accepted. What is the string to insert a colon as text in this formula? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I changed the : to a -, I could get past the initial compiling error.
So I may have an additional problem. I also have a "Run time error '13'; type mismatch" Please respond to both errors. "iashorty" wrote: I am using the following ActiveCell.FormulaR1C1 = "=CONCATENATE(PriorYear&" - "&PriorMonth&": "&VLOOKUP(RC[-26],'Prior Month'!R9C1:R1009C12,12,FALSE),CHAR(10),'Prior Month'!RC[-17])" to pull in prior month commentary and adding a date stamp with a COLON between the two. The above should look like: 2007-08: This situation... The colon in not being accepted. What is the string to insert a colon as text in this formula? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Are PriorYear and PriorMonth variables in your code or are they names in your
workbook? iashorty wrote: I am using the following ActiveCell.FormulaR1C1 = "=CONCATENATE(PriorYear&" - "&PriorMonth&": "&VLOOKUP(RC[-26],'Prior Month'!R9C1:R1009C12,12,FALSE),CHAR(10),'Prior Month'!RC[-17])" to pull in prior month commentary and adding a date stamp with a COLON between the two. The above should look like: 2007-08: This situation... The colon in not being accepted. What is the string to insert a colon as text in this formula? -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
They are range names to specific cells. These cells change based on an input
screen. i.e. input screen may have the current month and year and these cells show the previous month and year associated with that month. So if I am working on 2008-06 PriorYear will show 2008 and PriorMonth will show 05. The purpose is to bring in comments from the prior month, if applicable, to the current month data. "Dave Peterson" wrote: Are PriorYear and PriorMonth variables in your code or are they names in your workbook? iashorty wrote: I am using the following ActiveCell.FormulaR1C1 = "=CONCATENATE(PriorYear&" - "&PriorMonth&": "&VLOOKUP(RC[-26],'Prior Month'!R9C1:R1009C12,12,FALSE),CHAR(10),'Prior Month'!RC[-17])" to pull in prior month commentary and adding a date stamp with a COLON between the two. The above should look like: 2007-08: This situation... The colon in not being accepted. What is the string to insert a colon as text in this formula? -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe:
ActiveCell.FormulaR1C1 = "=PriorYear&"" - ""&PriorMonth&"":""&" _ & "VLOOKUP(RC[-26],'Prior Month'!R9C1:R1009C12,12,FALSE)" _ & "&CHAR(10)&'Prior Month'!RC[-17]" I dropped the =concatenate() and just used the & operand to join the text. And when you're using double quotes in strings in VBA, you double them up ("") to get a single double quote ("). iashorty wrote: They are range names to specific cells. These cells change based on an input screen. i.e. input screen may have the current month and year and these cells show the previous month and year associated with that month. So if I am working on 2008-06 PriorYear will show 2008 and PriorMonth will show 05. The purpose is to bring in comments from the prior month, if applicable, to the current month data. "Dave Peterson" wrote: Are PriorYear and PriorMonth variables in your code or are they names in your workbook? iashorty wrote: I am using the following ActiveCell.FormulaR1C1 = "=CONCATENATE(PriorYear&" - "&PriorMonth&": "&VLOOKUP(RC[-26],'Prior Month'!R9C1:R1009C12,12,FALSE),CHAR(10),'Prior Month'!RC[-17])" to pull in prior month commentary and adding a date stamp with a COLON between the two. The above should look like: 2007-08: This situation... The colon in not being accepted. What is the string to insert a colon as text in this formula? -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to change colon to semi-colon in CP/List Seprator | Excel Discussion (Misc queries) | |||
inserting colon into a value at a specific interval | Excel Programming | |||
Macro - Inserting text to a cell already containg text | Excel Discussion (Misc queries) | |||
inserting colon | Excel Programming | |||
Insert colon in text in cell | Excel Discussion (Misc queries) |