Lots of questions today! I have a subroutine that selects a range on sheet1. I then wish to calculate the average of that selection on sheet2 using another subroutine. The original selection on sheet1 is still selected. I know I could create a private variable that will be visible in both subroutines and populate that variable with the address of the selection. Then I could use that variable in the other subroutine. But I would prefer to be able to simply use that selection on sheet1 in the formula on sheet2.
Eg
'Assume that several cells on sheet1 are selected
Worksheets("Sheet2"
.Cells(4, 2).Formula = "=Average(" & Worksheets(1).Selection.Address & "
"
'This doesn't work
Is this possible?
Eg
'Assume that several cells on sheet1 are selected
Worksheets("Sheet2"
'This doesn't work
Is this possible?