Chris123149
New Member
- Joined
- Jul 2, 2019
- Messages
- 3
Hi All,
I was hoping somebody here could help me out with a particular line of code that i can't seem to get right. I'm looking to insert an "=average" code when a macro is run,, but the column index of each end of the range can vary depending on the active row. The actual code reads:
yrow = ActiveCell.Row
Cells(yrow, 34).Formula = "=average(range(cells(yrow,2).value):cells(yrow, 32).value)"
but keeps giving me an #name ? error in cell 34. What do i need to change to fix this?
I was hoping somebody here could help me out with a particular line of code that i can't seem to get right. I'm looking to insert an "=average" code when a macro is run,, but the column index of each end of the range can vary depending on the active row. The actual code reads:
yrow = ActiveCell.Row
Cells(yrow, 34).Formula = "=average(range(cells(yrow,2).value):cells(yrow, 32).value)"
but keeps giving me an #name ? error in cell 34. What do i need to change to fix this?