Userform for battery logging

CameronGates

New Member
Joined
Mar 7, 2019
Messages
18
Batterylift hours inhours outblanklift hours in hours outblank
RR01
RR231545
RR02
RR03
RR04
RR05RR2315451550
RR06
RR07
RR08RR231550
RR09

<tbody>
</tbody>


So I've got a spreadsheet formatted like this and I'd like to make a userform for it but am quite illiterate when it comes to Visual Basic. Basically this is a battery run time chart that is used to track how long the batteries are last between changes. When a lift comes in you populate the lift field with the lift number on the corresponding battery row and then populate the hours out with the hours from the lift. Then you populate the Lift number in the lift field with the corresponding battery row for the battery you are now inserting into the lift and then in the hours in field you populate it with the same hours you had in the hours out with the old depleted battery. We have three different people inputting data into this spreadsheet that are quite illiterate with spreadsheet data entry so a userform would be a great way to remove much of the human error out of data entry in this spreadsheet. Any help would be much appreciated!!!!
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
.
It's probably just me but ...

... what is a "LIFT" ?

... why does a "LIFT" use different batteries ?

... why does "LIFT" RR23 begin with battery RR01 / out at 1545 but that battery is never checked back in ?

... why does "LIFT" RR23 use three different batteries within 5 minutes time ?
 
Upvote 0
.
It's probably just me but ...

... what is a "LIFT" ?

... why does a "LIFT" use different batteries ?

... why does "LIFT" RR23 begin with battery RR01 / out at 1545 but that battery is never checked back in ?

... why does "LIFT" RR23 use three different batteries within 5 minutes time ?


I'm sorry let me clarify. A lift is a Forklift that is battery powered. RR23 is the lift number (I know I don't think batteries and lifts aught to be labeled the same however they are here). Basically we have 26 RR Lifts and 65 RR batteries. I was just giving an example of how the spreadsheet works with RR23 being the example lift and hours.
 
Upvote 0
.
Here is a sample of the macro :

Code:
Option Explicit
Private Sub btnCancel_Click()
    Unload Me
End Sub


Private Sub btnOK_Click()
    Dim ws As Worksheet
    Set ws = Sheets("Database")
    Dim newRow As Long
    
    newRow = Application.WorksheetFunction.CountA(ws.Range("A:A")) + 1
    
    'The next two lines can be expanded as many times as needed for all the entry fields in your project
    
    ws.Cells(newRow, 1).Value = Me.txtLift.Text
    ws.Cells(newRow, 2).Value = Me.txtBattery.Text
    ws.Cells(newRow, 3).Value = Me.txtHoursOut.Text
    
    Me.txtLift.Text = ""
    Me.txtBattery.Text = ""
    Me.txtHoursOut.Text = ""
    
    btnCancel_Click
    
End Sub


Download workbook : https://www.amazon.com/clouddrive/share/1NozGX3iu1fYPzn1Rr85qwVxRaC06dtHlWPK8RUeHZU
 
Last edited:
Upvote 0
Thank you very much for helping me out with this!!! I'm trying to download it now but I'm at work so it may be blocking me. As soon as I get to my house I will try it out. Thanks again!
 
Upvote 0
.
You are welcome.

Take note the second version has a report feature on the DATABASE tab.
You will need to 'unhide' that tab to access it.
 
Upvote 0
.
Received your PM.

Your mailbox is full so I cannot respond to you privately. You will need to empty your mailbox.
 
Upvote 0

Forum statistics

Threads
1,215,398
Messages
6,124,688
Members
449,179
Latest member
kfhw720

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