Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro needs to reference cell values in different worksheets
How to I program a macro to add two numbers from a different worksheet (in
the same workbook) and store the result in the current worksheet? I already tried, Cells(5, y).Value = Sheets("Summary").Cells(4, 2).Value + Sheets("Summary").Cells(5, 2).Value This is preceeded by a loop (also not working because of the worksheet reference) that looks across row 4 for a matching date so that it can put the daily data into the historical worksheet. This loop is controlled by: Do Until Cells(4, y).Value = Sheets("Summary").Cells(2, 3).Value I think the problem is in trying to reference the other sheet. If it was just a formula, I would use Summary!Cells(2,3) but that doesn't work in a macro either. I'm using Excel 2003. Thanks for your assistance. Jim |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro needs to reference cell values in different worksheets
Use the Worksheets object rather than the Sheets object:
Cells(5,y) = Worksheets("Summary").Cells(4, 2) + Worksheets("Summary").Cells(5, 2) "Capt Jim Cook" wrote in message ... How to I program a macro to add two numbers from a different worksheet (in the same workbook) and store the result in the current worksheet? I already tried, Cells(5, y).Value = Sheets("Summary").Cells(4, 2).Value + Sheets("Summary").Cells(5, 2).Value This is preceeded by a loop (also not working because of the worksheet reference) that looks across row 4 for a matching date so that it can put the daily data into the historical worksheet. This loop is controlled by: Do Until Cells(4, y).Value = Sheets("Summary").Cells(2, 3).Value I think the problem is in trying to reference the other sheet. If it was just a formula, I would use Summary!Cells(2,3) but that doesn't work in a macro either. I'm using Excel 2003. Thanks for your assistance. Jim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cell reference between worksheets | Excel Discussion (Misc queries) | |||
Macro to Create Worksheets Based on Cell Values | Excel Worksheet Functions | |||
How do I reference the same cell, but in different worksheets? | Excel Worksheet Functions | |||
Cell reference between worksheets | Excel Worksheet Functions | |||
How do I reference values from 200 worksheets onto a summary sheet | Excel Discussion (Misc queries) |