Rickinnocal
New Member
- Joined
- Dec 14, 2010
- Messages
- 33
- Office Version
- 365
- Platform
- Windows
Hello, everyone.
I have a worksheet that performs four-way interpolation on values taken from paper tables.
It has to do this for 40 sets of data. After the four data points are entered for the first tank and it produces the interpolated result, I created a Command Button to push the answer to a second sheet.
This works fine. However, I need 40 buttons to do the push for each tank (Actually 20 tanks, each has a 'Before' and 'After' value) I can just make 40 buttons, but is there an easier way to duplicate them without having to manually enter each macro code?
The code for the button I already have reads :
The row of the destination cell increases by 1 for each button, but the row of the source cell increases by 6.
Is there an easy-ish way to do this?
Thanks.
I have a worksheet that performs four-way interpolation on values taken from paper tables.
It has to do this for 40 sets of data. After the four data points are entered for the first tank and it produces the interpolated result, I created a Command Button to push the answer to a second sheet.
This works fine. However, I need 40 buttons to do the push for each tank (Actually 20 tanks, each has a 'Before' and 'After' value) I can just make 40 buttons, but is there an easier way to duplicate them without having to manually enter each macro code?
The code for the button I already have reads :
The code for the second button would need to read :Private Sub cmdSendData1_Click()
Worksheets("ROB (Before)").Range("i10").Value = Worksheets("Interpolator").Range("e9").Value
End Sub
Private Sub cmdSendData2_Click()
Worksheets("ROB (Before)").Range("i11").Value = Worksheets("Interpolator").Range("e15").Value
End Sub
The row of the destination cell increases by 1 for each button, but the row of the source cell increases by 6.
Is there an easy-ish way to do this?
Thanks.