Help required with VBA code

rohanmalhotra

New Member
Joined
May 4, 2010
Messages
29
Hi all

i have created a userform which will be used by multiple users. What i am looking to do is that the data from the userform is saved on 2 different locations.

1. in the same file so that users can see how much they have logged in a single day
2. to a different location, maybe in their personal drive so that they have a data dump and can refer to whenever they want.

can any one please help me with it? i have added the code.
HTML:
Sub SaveData()
    Dim LastRow As Object
    Dim ws As Worksheet
    Dim MyID As String
 
    Set ws = Worksheets("Data")
    Set LastRow = ws.Range("a65536").End(xlUp)
 
    LastRow.Offset(1, 0).Value = Me.txtStaffID.Value
    LastRow.Offset(1, 1).Value = Me.txtStaffName.Value
    LastRow.Offset(1, 2).Value = Me.txtDate.Value
    LastRow.Offset(1, 3).Value = Me.txtPCNumber.Value
    LastRow.Offset(1, 4).Value = Me.txtWorkitem.Value
    LastRow.Offset(1, 5).Value = Me.txtNSM.Value
    LastRow.Offset(1, 6).Value = Me.cboActivity.Value
    LastRow.Offset(1, 7).Value = Me.txtStartTime.Value
    LastRow.Offset(1, 8).Value = Me.txtEndTime.Value
    LastRow.Offset(1, 9).Value = Me.txtEntryRef.Value
    LastRow.Offset(1, 10).Value = Me.txtEntryDate.Value
    LastRow.Offset(1, 11).Value = Me.lblNotes.Caption
    LastRow.Offset(1, 12).Value = Me.ChkResld.Value
    LastRow.Offset(1, 13).Value = Me.ChkHandoff.Value
 
End Sub

Thanks for the help.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,224,505
Messages
6,179,147
Members
452,891
Latest member
JUSTOUTOFMYREACH

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