Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I'm trying to perform a concatenation within a macro using the recording fn,
but the syntax written into the macro is: +"*"&R[-1]C&"*" and once I copy this macro into my file, the concatenation obviously doesn't work. The concatenation is to generate barcode fields for the data in the cell above. so, it looks like +"*"&A2&"*" (given my source data is in cell A2). why is the macro converting this to +"*"&R[-1]C&"*"? Thanks. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If you look at the code that was recorded, you'll see that it's using the
..formulaR1C1 property. That means that it's building a string that uses R1C1 reference style--not A1 reference style. Activecell.formulaR1C1 = "=""*""&R[-1]C&""*""" Will build a formula to concatenate an asterisk with the value of the cell above the cell getting the formula (r[-1] is the previous row and c means the same column.) And I bet you changed the recorded code to something else before you posted in the newsgroups. (You lost some double quotes.) If this doesn't help, you'll want to post more of your code. wilson@irco wrote: I'm trying to perform a concatenation within a macro using the recording fn, but the syntax written into the macro is: +"*"&R[-1]C&"*" and once I copy this macro into my file, the concatenation obviously doesn't work. The concatenation is to generate barcode fields for the data in the cell above. so, it looks like +"*"&A2&"*" (given my source data is in cell A2). why is the macro converting this to +"*"&R[-1]C&"*"? Thanks. -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Dave; you're right I missed the double quotes, they were in there.
For some reason when I replaced the recorded code with your code, it worked. They both looked exactly alike. Thanks for the help. "Dave Peterson" wrote: If you look at the code that was recorded, you'll see that it's using the ..formulaR1C1 property. That means that it's building a string that uses R1C1 reference style--not A1 reference style. Activecell.formulaR1C1 = "=""*""&R[-1]C&""*""" Will build a formula to concatenate an asterisk with the value of the cell above the cell getting the formula (r[-1] is the previous row and c means the same column.) And I bet you changed the recorded code to something else before you posted in the newsgroups. (You lost some double quotes.) If this doesn't help, you'll want to post more of your code. wilson@irco wrote: I'm trying to perform a concatenation within a macro using the recording fn, but the syntax written into the macro is: +"*"&R[-1]C&"*" and once I copy this macro into my file, the concatenation obviously doesn't work. The concatenation is to generate barcode fields for the data in the cell above. so, it looks like +"*"&A2&"*" (given my source data is in cell A2). why is the macro converting this to +"*"&R[-1]C&"*"? Thanks. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Concatenation | Excel Discussion (Misc queries) | |||
Concatenation | Excel Worksheet Functions | |||
Concatenation | Excel Discussion (Misc queries) | |||
concatenation | Excel Discussion (Misc queries) | |||
Concatenation using IF AND - Possible? | Excel Worksheet Functions |