PDA

View Full Version : VBA to transfer data from one workbook to another



Rob Conklin
07-18-2017, 10:19 AM
With the help of others, I have created a workbook for our end users that allows them to submit spare part maintenance requests. The problem lies in the fact that we have 48 different locations that will be submitting these requests. Is it possible to create a command button that will only work for specified Windows user names, that when clicked will copy all of the data from the workbook to another workbook on a shared drive? In order to satisfy our internal audit we have to be able to track all of the changes, and having one location to look would take care of that.

jolivanes
07-18-2017, 07:38 PM
Sub Maybe()
MsgBox Environ$("UserName") '<---- To get the Username
If Environ$("UserName") = "Hillary" Then
MsgBox "Are you still around?" '<---- Your code would go here if any
Else
MsgBox "You do not have access to this file. Please contact the IT dept."
End If
End Sub