visitor sign in register

David899

New Member
Joined
Feb 1, 2023
Messages
8
Office Version
  1. 365
Platform
  1. Windows
I have the following code that copies a range of cells to another worksheet before moving to the next empty row.
target sheet has 4 headers: Date, Name,time in and time out.

Sub Staff_Signin()
'
' Staff_in Macro logs time staff signed in
'
Range("M3:O3").Select
Application.CutCopyMode = False
Selection.Copy
Sheet4.Select

Range("A" & Rows.Count).End(xlUp).Offset(1).Select

ActiveSheet.Paste
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False


Sheet2.Select
Range("D11").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "1"

Sheet1.Select
MsgBox "Thank You for signing in"

End Sub


i need a piece of code that looks at the first 3 columns and if matched pastes from ("N4") into the time out column without overriding original data.
1675267692116.png


Any help much appreciated.

D
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Sorry had the wrong column in target
should have been as below

i need a piece of code that looks at the first 3 columns and if matched copies cell ("J11") into the time out ("P4) column without overriding original data.
 
Upvote 0
It is hard to work with a picture. It would be easier to help if you could use the XL2BB add-in (icon in the menu) to attach screenshots (not pictures) of your sheets. Alternately, you could upload a copy of your file to a free site such as www.box.com or www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary).
 
Upvote 0
Thanks Mumps, great suggestion, guessing sharepoint would work
 
Upvote 0
Not sure about Sharepoint. Best to try DropBox.com or Box.com
 
Upvote 0
here is a link to my spread sheet

sheet 1 is a simple redirect to either staff or guest and can be ignored for now
sheet 2 is where i am struggling, the macro assigning to the sign IN button copies the information in range ("M3:O3") and pastes it to the next available row in sheet 4 (log).
I am trying to write a second macro to assign to the sign OUT button that copies the time and pastes it to the relevant row in sheet4 depending on the name shown in ("N3").

again any help really appreciated, anyone wanting to use the finished project is welcome.

thanks in advance
D
 
Upvote 0
Try this:
All is needed to Type EMP name in Call A5, then B5 will stamp Time and date, C5 will stamp the name.

1675270987102.png
 
Upvote 0
Click here to download your file. I have modified the Staff sheet to unmerge the merged cells. You should avoid merging cells because they almost always cause problems for macros. I have also deleted the data to the right. When you click on B11, a calendar pops up for the user to select a date. When an initial is selected in C11, the Name and Time In are automatically populated. Clicking the Sign In button copies the data to the Log. Clicking the Sign Out button copies the time to F11 and to the Log. Give it a try and let me know how it works out.
 
Upvote 0
Thanks for this Mumps. sounds perfect but the hyperlink doesn't seem to work
 
Upvote 0
Click here to download your file. I have modified the Staff sheet to unmerge the merged cells. You should avoid merging cells because they almost always cause problems for macros. I have also deleted the data to the right. When you click on B11, a calendar pops up for the user to select a date. When an initial is selected in C11, the Name and Time In are automatically populated. Clicking the Sign In button copies the data to the Log. Clicking the Sign Out button copies the time to F11 and to the Log. Give it a try and let me know how it works out.
Thanks for this Mumps, sounds perfect but hyperlink doesn't seem to work
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

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