Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default string within formula

Right now I'm setting the formula on range like this:

oSubTotalSheet.Range("A1:A" & lngLastRow).Formula = "=A1&B1&C1&D1"

I need to insert a delimiter between each cell in the concatenation.
Something like this:

oSubTotalSheet.Range("A1:A" & lngLastRow).Formula =
"=A1&'|'&B1&'|'&C1&'|'&D1"

Is there a way I can do this with a one-liner? I suppose I could just
loop though each row and put the actual value in, but I hoped I go get
this to work.

Thanks,
Woody

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default string within formula


Hi,

oSubTotalSheet.Range("A1:A" & lngLastRow).Formula =
"=A1 & ""|"" & B1 & ""|"" & C1& ""|"" & D1"

Your current formula will give a circular reference.

HTH

"sugargenius" wrote:

Right now I'm setting the formula on range like this:

oSubTotalSheet.Range("A1:A" & lngLastRow).Formula = "=A1&B1&C1&D1"

I need to insert a delimiter between each cell in the concatenation.
Something like this:

oSubTotalSheet.Range("A1:A" & lngLastRow).Formula =
"=A1&'|'&B1&'|'&C1&'|'&D1"

Is there a way I can do this with a one-liner? I suppose I could just
loop though each row and put the actual value in, but I hoped I go get
this to work.

Thanks,
Woody


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
IF formula string Taylor Excel Worksheet Functions 2 June 19th 08 04:50 PM
Converting a Formula stored as String to real Formula BlueD Excel Worksheet Functions 3 January 14th 08 07:48 PM
Formula to Replace or eliminate any sheetname(s) in formula string EagleOne Excel Discussion (Misc queries) 0 September 20th 06 06:36 PM
Use a string in a formula Jos Vens[_2_] Excel Programming 8 March 2nd 05 09:30 PM
Create a formula into a String then assign string to a cell Myrna Larson[_2_] Excel Programming 6 August 23rd 03 09:42 PM


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