Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Writing a formula in a variable

Hi, hope someone out there can help me with this problem.

I have a simple formula:

=CONCATENATE((MID(A1,4,3)),"_",C1,"_",((IF(MID(A1, 7,1)
"A","Activity","List"))))

and i'd like that formula to be contained in a variable so that i can
use the formula on many worksheets within a workbook.

The problem that i'm coming across is to do with all the quotation
marks. Excel won't let me simply write:

formula1 = CONCATENATE((MID(A1,4,3)),"_",C1,"_",((IF(MID(A1,7 ,1)
"A","Activity","List"))))

Dows anyone have any suggestions about how to overcome this - maybe by
splitting the formula up into smaller components???


any helps greatly apprecieted.

chris
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Writing a formula in a variable

formula1 = "CONCATENATE((MID(A1,4,3)),""_"",C1,""_"",((IF(MID (A1,7,1)
""A"",""Activity"",""List""))))"

Regards,
Tom Ogilvy


"Chris Dunigan" wrote in message
m...
Hi, hope someone out there can help me with this problem.

I have a simple formula:

=CONCATENATE((MID(A1,4,3)),"_",C1,"_",((IF(MID(A1, 7,1)
"A","Activity","List"))))

and i'd like that formula to be contained in a variable so that i can
use the formula on many worksheets within a workbook.

The problem that i'm coming across is to do with all the quotation
marks. Excel won't let me simply write:

formula1 = CONCATENATE((MID(A1,4,3)),"_",C1,"_",((IF(MID(A1,7 ,1)
"A","Activity","List"))))

Dows anyone have any suggestions about how to overcome this - maybe by
splitting the formula up into smaller components???


any helps greatly apprecieted.

chris



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Writing a formula in a variable

Just to add.
I showed you how to set up the string you showed - I am not sure the string
you showed is a valid formula, but you should be able to adapt what I
provided.

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
formula1 = "CONCATENATE((MID(A1,4,3)),""_"",C1,""_"",((IF(MID (A1,7,1)
""A"",""Activity"",""List""))))"

Regards,
Tom Ogilvy


"Chris Dunigan" wrote in message
m...
Hi, hope someone out there can help me with this problem.

I have a simple formula:

=CONCATENATE((MID(A1,4,3)),"_",C1,"_",((IF(MID(A1, 7,1)
"A","Activity","List"))))

and i'd like that formula to be contained in a variable so that i can
use the formula on many worksheets within a workbook.

The problem that i'm coming across is to do with all the quotation
marks. Excel won't let me simply write:

formula1 = CONCATENATE((MID(A1,4,3)),"_",C1,"_",((IF(MID(A1,7 ,1)
"A","Activity","List"))))

Dows anyone have any suggestions about how to overcome this - maybe by
splitting the formula up into smaller components???


any helps greatly apprecieted.

chris





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Writing a formula in a variable

Tom,

You're right - my formula was slightly wrong, but have tweaked it and
you're suggestion works perfectly.

Many Thanks,
Chris






"Tom Ogilvy" wrote in message ...
Just to add.
I showed you how to set up the string you showed - I am not sure the string
you showed is a valid formula, but you should be able to adapt what I
provided.

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
formula1 = "CONCATENATE((MID(A1,4,3)),""_"",C1,""_"",((IF(MID (A1,7,1)
""A"",""Activity"",""List""))))"

Regards,
Tom Ogilvy


"Chris Dunigan" wrote in message
m...
Hi, hope someone out there can help me with this problem.

I have a simple formula:

=CONCATENATE((MID(A1,4,3)),"_",C1,"_",((IF(MID(A1, 7,1)
"A","Activity","List"))))

and i'd like that formula to be contained in a variable so that i can
use the formula on many worksheets within a workbook.

The problem that i'm coming across is to do with all the quotation
marks. Excel won't let me simply write:

formula1 = CONCATENATE((MID(A1,4,3)),"_",C1,"_",((IF(MID(A1,7 ,1)
"A","Activity","List"))))

Dows anyone have any suggestions about how to overcome this - maybe by
splitting the formula up into smaller components???


any helps greatly apprecieted.

chris



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
writing an formulae with variable parameters Formulas with variable parameters Excel Worksheet Functions 2 June 19th 09 06:58 PM
Writing variable from a Macro to a Cell Parker[_3_] Excel Programming 5 September 28th 03 03:47 AM
writing a variable to a cell Tom Ogilvy Excel Programming 0 July 17th 03 04:22 PM
writing a variable to a cell Reg Besseling Excel Programming 0 July 17th 03 04:00 PM


All times are GMT +1. The time now is 06:06 PM.

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"