Copy Formula

proctk

Well-known Member
Joined
Dec 24, 2004
Messages
840
Hi

I created userform which is used to enter data in to my database. I'm trying to figure out a way so that each time a new entery is keyed

a formula is copied into a cell

Sheet Name: Branchtracking

formula need in in column G = ( column F - Column E - Column D)

Code attached to command button to send data to worksheet

Code:
Private Sub CommandButton1_Click()
Dim iRow As Long
 
   Sheets("BranchTracking").Select
        iRow = Sheets("BranchTracking").Cells(65000, 4).End(xlUp).Offset(1, 0).Row
        
        Cells(iRow, 1).Value = Me.Day.Value
        Cells(iRow, 2).Value = Me.Emp.Value
        Cells(iRow, 3).Value = Me.Activity.Value
        Cells(iRow, 4).Value = Me.Pissued.Value
        Cells(iRow, 5).Value = Me.TOut.Value
        Cells(iRow, 6).Value = Me.TIn.Value
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,215,005
Messages
6,122,661
Members
449,091
Latest member
peppernaut

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