Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
writing an formulae with variable parameters | Excel Worksheet Functions | |||
Writing variable from a Macro to a Cell | Excel Programming | |||
writing a variable to a cell | Excel Programming | |||
writing a variable to a cell | Excel Programming |