Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code to calculate the difference between rows
The range references below will all refer to the active sheet.
Alan Beban Alan Beban wrote: E.g., =a2:d2-a1:d1 array entered into a 4-cell row. If you really want VBA code Range("a6:d6") = [a2:d2-a1:d1] Or to put the results into an array instead of dumping them onto the worksheet Dim arr() arr = [a2:d2-a1:d1] Alan Beban Desmond wrote: Hello, I have two rows of numbers in cells. I need the VBA code that will subtract each cell value in one line from the cell in the same column in the other line. I created a macro that subtracts the first cell and copies across the row, but with the worksheet protected this does not work. I tried a recorded macro subtracting each cell separately, and this seems to work. So I believe I need a loop structure, and I am having trouble with this. Your assistance would be appreciated. I know little of programming, so your help would be valuable Thanks desmond |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro code to hide rows and not calculate hidden rows | Excel Discussion (Misc queries) | |||
Calculate difference in dates | Excel Discussion (Misc queries) | |||
calculate the difference between two cells | Excel Discussion (Misc queries) | |||
How can I calculate the difference between times without using th. | Excel Worksheet Functions | |||
VBA code to calculate the difference between rows | Excel Programming |