Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Having some trouble with inserting formula. Sub formula() Columns("H:H").Select Selection.Insert Shift:=xlToRight Range("I1").Select Selection.Copy Range("H1").Select ActiveSheet.Paste 'Range("H2").Select ' Application.CutCopyMode = False ' this is the formula but I get a compile error message end of statement 'activecell.FormulaR1C1 = "=J2&" "&K2" ' I need to put a space between J2 and K2, otherwise the strings aren't seperated with a space End Sub How can I solve this? Or should I |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
activecell.FormulaR1C1 = "=J2&"" ""&K2"
demo'd from the immediate window for confidence: ? "=J2&"" ""&K2" =J2&" "&K2 so double up double quotes when within double quotes -- regards, Tom Ogilvy "Jootje" wrote: Hi, Having some trouble with inserting formula. Sub formula() Columns("H:H").Select Selection.Insert Shift:=xlToRight Range("I1").Select Selection.Copy Range("H1").Select ActiveSheet.Paste 'Range("H2").Select ' Application.CutCopyMode = False ' this is the formula but I get a compile error message end of statement 'activecell.FormulaR1C1 = "=J2&" "&K2" ' I need to put a space between J2 and K2, otherwise the strings aren't seperated with a space End Sub How can I solve this? Or should I |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hmmm, still not working, this is what I get:
='I2'&" "&'J2' "Tom Ogilvy" wrote: activecell.FormulaR1C1 = "=J2&"" ""&K2" demo'd from the immediate window for confidence: ? "=J2&"" ""&K2" =J2&" "&K2 so double up double quotes when within double quotes -- regards, Tom Ogilvy "Jootje" wrote: Hi, Having some trouble with inserting formula. Sub formula() Columns("H:H").Select Selection.Insert Shift:=xlToRight Range("I1").Select Selection.Copy Range("H1").Select ActiveSheet.Paste 'Range("H2").Select ' Application.CutCopyMode = False ' this is the formula but I get a compile error message end of statement 'activecell.FormulaR1C1 = "=J2&" "&K2" ' I need to put a space between J2 and K2, otherwise the strings aren't seperated with a space End Sub How can I solve this? Or should I |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
try:
activecell.Formula = "=J2&"" ""&K2" Jootje wrote: Hmmm, still not working, this is what I get: ='I2'&" "&'J2' "Tom Ogilvy" wrote: activecell.FormulaR1C1 = "=J2&"" ""&K2" demo'd from the immediate window for confidence: ? "=J2&"" ""&K2" =J2&" "&K2 so double up double quotes when within double quotes -- regards, Tom Ogilvy "Jootje" wrote: Hi, Having some trouble with inserting formula. Sub formula() Columns("H:H").Select Selection.Insert Shift:=xlToRight Range("I1").Select Selection.Copy Range("H1").Select ActiveSheet.Paste 'Range("H2").Select ' Application.CutCopyMode = False ' this is the formula but I get a compile error message end of statement 'activecell.FormulaR1C1 = "=J2&" "&K2" ' I need to put a space between J2 and K2, otherwise the strings aren't seperated with a space End Sub How can I solve this? Or should I -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
AH! Thanks, that's it!
"Dave Peterson" wrote: try: activecell.Formula = "=J2&"" ""&K2" Jootje wrote: Hmmm, still not working, this is what I get: ='I2'&" "&'J2' "Tom Ogilvy" wrote: activecell.FormulaR1C1 = "=J2&"" ""&K2" demo'd from the immediate window for confidence: ? "=J2&"" ""&K2" =J2&" "&K2 so double up double quotes when within double quotes -- regards, Tom Ogilvy "Jootje" wrote: Hi, Having some trouble with inserting formula. Sub formula() Columns("H:H").Select Selection.Insert Shift:=xlToRight Range("I1").Select Selection.Copy Range("H1").Select ActiveSheet.Paste 'Range("H2").Select ' Application.CutCopyMode = False ' this is the formula but I get a compile error message end of statement 'activecell.FormulaR1C1 = "=J2&" "&K2" ' I need to put a space between J2 and K2, otherwise the strings aren't seperated with a space End Sub How can I solve this? Or should I -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I free up the space occupied by empty rows? | Excel Discussion (Misc queries) | |||
How do I move cursor to next empty space?? | Excel Programming | |||
Altering code to accomodate empty space | Excel Programming | |||
Empty space around charts when copying | Excel Discussion (Misc queries) | |||
Empty space in formulas. | Excel Worksheet Functions |