Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am trying to insert a formula into a cell and am having trouble. I am substituting the variable 'sheetname' for 'Sheet1'. Here's my code: Sub AddToList(SheetName) Dim LastusedrowinD As Long 'The Formula is =Cell("filename" ,'Sheet1'!$A$1) With Sheets("Table") LastusedrowinD = .Cells(.Rows.Count, "D").End(xlUp).Row .cell("D" & LastusedrowinD).Value = _ "=Cell(" & "filename" & ",'" & SheetName & "'!$A$1)" End With End Sub Any suggestions as to how I would add this formula into the cell? Thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find a cell and then insert a formula into adjacent cell | Excel Programming | |||
Insert a formula into the last row of a cell | Excel Programming | |||
Insert Formula in Cell with VBA | Excel Programming | |||
Using VBA to Insert a formula in a cell | Excel Programming | |||
Insert value of formula into cell | Excel Programming |