Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Mix of relative and absolute?

I'm working on a macro that has the following line:

ActiveCell.FormulaR1C1 =
"=CONCATENATE(CHAR(10),RC[-3],CHAR(10),RC[-2],CHAR(10),RC[-1])"

And I want to insert text before the first character return...as in:

ActiveCell.FormulaR1C1 =
"=CONCATENATE("text",CHAR(10),RC[-3],CHAR(10),RC[-2],CHAR(10),RC[-1])"

Is this possible?
Thanks,
M John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Mix of relative and absolute?

Yes, or at least it should be - the formula is simply a string - for
example recording a simple macro that concatenates two cells with a
space between them gives

"=R[-6]C&"" ""&R[-5]C"

NOTE the double quotes to give a quote within a string (you could also
use chr$(34) to return a double quote)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Mix of relative and absolute?


I think this should work for you.

ActiveCell.FormulaR1C1 = "=CONCATENATE(" & Chr$(34) & "TEXT" & Chr$(34)
& ",CHAR(10),RC[-3],CHAR(10),RC[-2],CHAR(10),RC[-1])"

-I'm working on a macro that has the following line:

ActiveCell.FormulaR1C1 =
"=CONCATENATE(CHAR(10),RC[-3],CHAR(10),RC[-2],CHAR(10),RC[-1])"

And I want to insert text before the first character return...as in:

ActiveCell.FormulaR1C1 =
"=CONCATENATE("text",CHAR(10),RC[-3],CHAR(10),RC[-2],CHAR(10),RC[-1])"

Is this possible?
Thanks,
M John-


--
Ikaabod
------------------------------------------------------------------------
Ikaabod's Profile: http://www.excelforum.com/member.php...o&userid=33371
View this thread: http://www.excelforum.com/showthread...hreadid=536797

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Mix of relative and absolute?

Excellent. Glad it was do-able.
Most appreciated.

Thanks,
Mj

" wrote:

Yes, or at least it should be - the formula is simply a string - for
example recording a simple macro that concatenates two cells with a
space between them gives

"=R[-6]C&"" ""&R[-5]C"

NOTE the double quotes to give a quote within a string (you could also
use chr$(34) to return a double quote)


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Mix of relative and absolute?

Thank you. Excellent work.

MJohn

"Ikaabod" wrote:


I think this should work for you.

ActiveCell.FormulaR1C1 = "=CONCATENATE(" & Chr$(34) & "TEXT" & Chr$(34)
& ",CHAR(10),RC[-3],CHAR(10),RC[-2],CHAR(10),RC[-1])"

-I'm working on a macro that has the following line:

ActiveCell.FormulaR1C1 =
"=CONCATENATE(CHAR(10),RC[-3],CHAR(10),RC[-2],CHAR(10),RC[-1])"

And I want to insert text before the first character return...as in:

ActiveCell.FormulaR1C1 =
"=CONCATENATE("text",CHAR(10),RC[-3],CHAR(10),RC[-2],CHAR(10),RC[-1])"

Is this possible?
Thanks,
M John-


--
Ikaabod
------------------------------------------------------------------------
Ikaabod's Profile: http://www.excelforum.com/member.php...o&userid=33371
View this thread: http://www.excelforum.com/showthread...hreadid=536797


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
absolute & relative references zzulu4 Excel Discussion (Misc queries) 2 April 1st 09 05:54 PM
Relative and absolute hyperlinks Musette New Users to Excel 2 October 4th 07 06:47 AM
Absolute vs Relative path K2H Excel Discussion (Misc queries) 2 July 28th 05 12:50 PM
Absolute / Relative References Tim Mills Excel Programming 2 July 25th 05 12:32 PM
Chg Absolute to Relative Adresmith[_8_] Excel Programming 1 October 29th 04 07:23 PM


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