Transfer data entered in cells to another spreadsheet with button then clear data and update total of hours

BHME

New Member
Joined
Mar 25, 2022
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
I have a spreadsheet which records dates and hours gained during a month / year, then it records these dates and hours on a second sheet. I am having an issue with it not recording more than 2 lines and seems to overwrite the second line constantly.

I would also like to somehow get an up-to-date total showing (Balance to Date). I can get it working once, however when I then press the Transfer button, it changes the Balance to Date back to Toil to Date total.

Private Sub CommandButton1_Click()

Dim DateToilUsed As String, AmountTOILUsed As String

Worksheets("TOIL Tracker").Select
DateToilUsed = Range("NL9")
AmountTOILUsed = Range("NM9")
Worksheets("TOIL Usage").Select
Worksheets("TOIL Usage").Range("B3").Select

If Worksheets("TOIL Usage").Range("B3").Offset(1, 0) <> "" Then
Worksheets("TOIL Usage").Range("B3").End(xlDown).Select
End If
ActiveCell.Offset(1, 0).Select
ActiveCell.Value = DateToilUsed
ActiveCell.Offset(0, 1).Select
ActiveCell.Value = AmountTOILUsed

Worksheets("TOIL Tracker").Select
Worksheets("TOIL Tracker").Range("NL9:NM9").ClearContents

End Sub



1648182968125.png


1648182932666.png
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,214,837
Messages
6,121,883
Members
449,057
Latest member
Moo4247

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top