Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm kind of green with Excel - this may well be an elementary issue...
I add a series of worksheets to a new workbook with automation from Access. But the first worksheet in the workbook is a summary worksheet and simply displays data that's already on the other worksheets - so I figure I can just point to the cells in the other worksheets with a formula to get those values. Here's what I'm using as formulas: strLastTest = "=" & wksName & "!A" & lr strAverage = "=" & wksName & "!B" & lr strStdDev = "=" & wksName & "!C" & lr (lr is a variable that holds the last row value) Here's how I'm trying to insert the formulas: xlapp.Workbooks(strXlsFile).Worksheets("Summary"). Cells(i + 1, 2).Formula = strLastTest xlapp.Workbooks(strXlsFile).Worksheets("Summary"). Cells(i + 1, 3).Formula = strAverage xlapp.Workbooks(strXlsFile).Worksheets("Summary"). Cells(i + 1, 4).Formula = strStdDev (This code is in a loop so the i + 1 just adds the next summary data in the next row) I keep getting: Error Number1004: Application-defined or object-defined error I'm not sure if there's something wrong with my code (probably) or if the problem is due to the fact that "wksName & "!B & lr" (and the others) is a cell that gets its value from a formula. Could this cause the problem? Am I referencing the cells on the other worksheets correctly? Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Enter info in one sheet, auto enter in another based on one field | New Users to Excel | |||
How to enter an Excel cell reference into a line of text in Excel | Excel Worksheet Functions | |||
enter data on 1 sheet and make it enter on next avail row on 2nd s | Excel Discussion (Misc queries) | |||
Enter an Excel cell reference as part of a custom header/footer | Excel Worksheet Functions | |||
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet | Excel Programming |