Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Inserting colon as text

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Inserting colon as text

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Inserting colon as text

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Inserting colon as text

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Inserting colon as text

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
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 change colon to semi-colon in CP/List Seprator Khoshravan Excel Discussion (Misc queries) 3 February 4th 09 07:41 PM
inserting colon into a value at a specific interval [email protected] Excel Programming 4 August 1st 07 07:54 PM
Macro - Inserting text to a cell already containg text Dileep Chandran Excel Discussion (Misc queries) 6 December 7th 06 03:42 PM
inserting colon xtrmhyper[_8_] Excel Programming 8 July 1st 06 07:28 PM
Insert colon in text in cell Phoenix Excel Discussion (Misc queries) 4 February 3rd 06 09:16 AM


All times are GMT +1. The time now is 01:59 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"