Copy a value to a cell in a worksheet.
You want to show the user some output.
A variable with a value in it. The row and column of the cell that the value will be copied into.
A happy user.
- Cells(THE ROW, THE COLUMN) = THE VALUE
Excel will copy THE VALUE into the cell with row THE ROW, and column THE COLUMN.
- Cells(2, 2) = sTotal
You can output an expression, if you like:
- Cells(2, 2) = sTotal / sCount
For the row and column, you can use anything that will give you a number, including variables and expressions.
- sRow = 7
- Cells(sRow, 2) = sTotal
- Cells(sRow + 1, 2) = sCount
- Cells(sRow + 2, 2) = sTotal / sCount