Hi dear All!!
I ve been searching around the web but no good luck so far. I need a macro if possible to allow me to always paste into a table's first row moving the old data below ( not overwriting them and expanding to keep all the old data plus the new data that occupied the first row)
Now the target table (where the new data should be pasted in 1st row) has 2 more columns in the right which include some functions.
The Pasted data are these 2 columns short
Feeder table = a pivot table from which i copy the data
Target table = a table range named "t_StakeHistory"
i would like to have a macro button in the sheet called "Stakes" where the feeder exist in order to
1)copy the selected data from the pivot table
2)move to sheet "Stakes History"
3)paste the data in the top row of table "t_StakeHistory", without overwriting existing data, but moving all data down
* I select the data range to be copied from the pivot table using below code
Is there any chance to continue after this code with the rest of the actions i need to accomplish, so i only have 1 macro button to copy the data from 1 sheet & go and paste them as described?
Thank you in advance
I ve been searching around the web but no good luck so far. I need a macro if possible to allow me to always paste into a table's first row moving the old data below ( not overwriting them and expanding to keep all the old data plus the new data that occupied the first row)
Now the target table (where the new data should be pasted in 1st row) has 2 more columns in the right which include some functions.
The Pasted data are these 2 columns short
Feeder table = a pivot table from which i copy the data
Betakos Stake Calculator 1.3.1_Test.xlsm | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | |||
1 | ||||||||||||
2 | Match Day | PickNo | Match | Pick | Odds | Bookie | Final Stakes | Profit / Loss | ||||
3 | 1/2/2021 | 1 | (blank) | (blank) | 3,50 | (blank) | 10,00 € | 25,00 € | ||||
4 | ||||||||||||
5 | ||||||||||||
6 | ||||||||||||
7 | ||||||||||||
8 | ||||||||||||
9 | ||||||||||||
10 | ||||||||||||
Stakes |
Target table = a table range named "t_StakeHistory"
Betakos Stake Calculator 1.3.1_Test.xlsm | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | |||
1 | |||||||||||||
2 | |||||||||||||
3 | |||||||||||||
4 | Match Day | PickNo | Match | Pick | Odds | Bookie | Final Stakes | Profit / Loss | Result | P/L | |||
5 | 1/2/2021 | 1 | (blank) | (blank) | 3,50 | (blank) | 10,00 € | 25,00 € | w | 25,00 € | |||
6 | |||||||||||||
7 | |||||||||||||
8 | |||||||||||||
9 | |||||||||||||
10 | |||||||||||||
Stakes History |
Cell Formulas | ||
---|---|---|
Range | Formula | |
K5 | K5 | =IF([@Result]="W",[@[Profit / Loss]],IF([@Result]="V",0,IF([@Result]="L",-[@[Profit / Loss]],""))) |
Cells with Conditional Formatting | ||||
---|---|---|---|---|
Cell | Condition | Cell Format | Stop If True | |
B5:K5 | Expression | =IF($J5="L";1;0) | text | NO |
B5:K5 | Expression | =IF($J5="V";1;0) | text | NO |
B5:K5 | Expression | =IF($J5="W";1;0) | text | NO |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
J5 | List | =ResultSymbols |
i would like to have a macro button in the sheet called "Stakes" where the feeder exist in order to
1)copy the selected data from the pivot table
2)move to sheet "Stakes History"
3)paste the data in the top row of table "t_StakeHistory", without overwriting existing data, but moving all data down
* I select the data range to be copied from the pivot table using below code
VBA Code:
Sub Selectpvt_FinalStakes()
Dim pt As PivotTable
Set pt = ActiveSheet.PivotTables("pvt_FinalStakes")
Dim Rng As Range
Set Rng = pt.RowRange
Set Rng = Rng.Offset(1, 0).Resize(Rng.Rows.Count - 1)
Rng.Select
End Sub
Is there any chance to continue after this code with the rest of the actions i need to accomplish, so i only have 1 macro button to copy the data from 1 sheet & go and paste them as described?
Thank you in advance