Ready, steady… save!
You don’t need a chart to join in. Here are 2 ways to record your savings:
1. Cross it off
Pop a chart into your first post. Saved an amount? Cross it out! Read more »
£0.01 £0.02 £0.03
2. Write it down
Skip the chart and add updates to your first post. Read more »
“Another +£3 saved today. Go me!”
Use +£ before each new saving so it counts towards your total.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
Excel : Clickable buttons to copy a value to "current month" field?
Comments
-
I hope the below helps to explain it better
The way I want it to work
- Shopping total to be added up, simple SUM put into cell D15
- Click the button "save to master list", the value from D15 is put into relevant month / year cell
Ignore it being replicated thats because of the formula when I was playing around, in this instance when clicking the button I would want to put the value from D15 in cell K2 (if today was really month end)
EDIT - I know I can manually copy it
However, I'm trying to automate it if possible, because I may be adding in a lot more advanced functions at a later date, since the Excel sheet already has quite a bit of stuff in now

Owner of andrewhope.co.uk, hate cars and love them
Working towards DFD
HSBC Credit Card - £2700 / £7500
AA Loans - (cleared £9700)0 -
Try:
total = ActiveSheet.Range("d15") monthx = Month(Date) yearx = Year(Date) yearmatch = WorksheetFunction.Match(yearx, Range("D:D"), 0) - 1 Range("d1").Select ActiveCell.Offset(yearmatch, monthx).Select ActiveCell.Value = totalIt will take the month and year from todays date and find the corresponding cell and enter D15 in it.0 -
Try:
It will take the month and year from todays date and find the corresponding cell and enter D15 in it.
Thanks for the help Phil
You can use [code] to get rid of smilies
I get an error in the script
"runtime error 1004: range of object_global failed"
When going to VB Debug, it highlights this....
yearmatch = WorksheetFunction.Match(yearx, Range("D : D"), 0) - 1Owner of andrewhope.co.uk, hate cars and love them
Working towards DFD
HSBC Credit Card - £2700 / £7500
AA Loans - (cleared £9700)0 -
Have you taken the spaces out of the range bit? You might also have to make it D1: D12, sometimes you can get away with naming the column, other times it likes an exact range.0
-
Have you taken the spaces out of the range bit? You might also have to make it D1: D12, sometimes you can get away with naming the column, other times it likes an exact range.
thanks ill try it now, i didn't notice there was spaces (because of smilies)
Owner of andrewhope.co.uk, hate cars and love them
Working towards DFD
HSBC Credit Card - £2700 / £7500
AA Loans - (cleared £9700)0 -
Cheers Phil your a star
Was just the range because of the smilies without spaces, removed them and it put the value in the correct month
Thanks
Owner of andrewhope.co.uk, hate cars and love them
Working towards DFD
HSBC Credit Card - £2700 / £7500
AA Loans - (cleared £9700)0
This discussion has been closed.
Confirm your email address to Create Threads and Reply
Categories
- All Categories
- 355.9K Banking & Borrowing
- 255K Reduce Debt & Boost Income
- 456.2K Spending & Discounts
- 248.4K Work, Benefits & Business
- 606.1K Mortgages, Homes & Bills
- 179.1K Life & Family
- 264K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.2K Discuss & Feedback
- 37.7K Read-Only Boards