Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I seem to have problems to add a formula to a cell. I generat a string like "=SUM(A1;H7;U7)" and apply it like ActiveSheet.Cells(y + k + 1, x + 1).Value = sValue ActiveSheet.Cells(y + k + 1, x + 1).Text = sValue ActiveSheet.Cells(y + k + 1, x + 1).Formula = sValue and the all give an "object error" why???? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
You should use the Formula property, not Value (and certainly not Text, which is read only). Try removing the semi-colons from the string and replacing with commas (even though I presume your excel version uses ; in formulas). So sValue becomes: sValue = SUM(A1,H7,U7) Richard "jodleren" wrote in message ... Hi I seem to have problems to add a formula to a cell. I generat a string like "=SUM(A1;H7;U7)" and apply it like ActiveSheet.Cells(y + k + 1, x + 1).Value = sValue ActiveSheet.Cells(y + k + 1, x + 1).Text = sValue ActiveSheet.Cells(y + k + 1, x + 1).Formula = sValue and the all give an "object error" why???? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Oct 8, 12:16*pm, "Richard Schollar"
wrote: Hi You should use the Formula property, not Value (and certainly not Text, which is read only). Try removing the semi-colons from the string and replacing with commas (even though I presume your excel version uses ; in formulas). *So sValue becomes: sValue = SUM(A1,H7,U7) Thanks, that's helped |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding formula to a cell with VB | Excel Programming | |||
formula for adding every other cell in Excel | Excel Worksheet Functions | |||
adding a formula in a cell but when cell = 0 cell is blank | Excel Worksheet Functions | |||
Adding a prefix to a cell by using a formula | Excel Discussion (Misc queries) | |||
Adding a comment to a formula-not a cell | Excel Discussion (Misc queries) |