Home |
Search |
Today's Posts |
#1
|
|||
|
|||
capture date at another sheets using Marlett
I need an expert like you to solve my problem.
I have a Attendant Table for Staff, which consists of Name, Staff ID and so on. I have already create the code for “Automatic appearance of date in Column D when you Double Click the Column C of attendance column “. The code is like this: Option Explicit Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) 'Limit Target count to 1 If Target.Count 1 Then Exit Sub 'Isolate Target to a specific range If Intersect(Target, Range("CheckBoxs")) Is Nothing Then Exit Sub 'Set Target font to "marlett" Target.Font.Name = "marlett" 'Check value of target If Target.Value < "a" Then Target.Value = "a" 'Sets target Value = "a" Cancel = True Exit Sub End If If Target.Value = "a" Then Target.ClearContents 'Sets target Value = "" Cancel = True Exit Sub End If End Sub Private Sub Worksheet_Change(ByVal Target As Range) 'Limit Target count to 1 If Target.Count 1 Then Exit Sub 'Isolate Target to a specific range If Intersect(Target, Range("CheckBoxs")) Is Nothing Then Exit Sub 'Select a specific subset of the range "Ckboxes" Select Case Target.Address Case Else If Target.Value = "a" Then Target.Offset(0, 1).Value = Date Else: Target.Offset(0, 1).Value = "" End If End Select Name and staff id already available in sheet2. Sheet2 is the database that will be store all the information. Date that will captured is current date(today date) when double click the Column C of attendance column then date will appear. I will clicking in the row at attendance column. The tick is create by using marlett function. You can refer the coding above.The action should be done is like this, if sheet2 have similar name and staff id like in sheet1 then date is should copy or ??? in sheet2 (column date) I hope you can help me bout this problem. I attach an image to clear what I need. I appreciate your help. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
capture date at another sheets using Marlett
Your worksheet event code works fine. However I don't understand what you
want to do, in particular - The action should be done is like this, if sheet2 have similar name and staff id like in sheet1 then date is should copy or ??? in sheet2 (column date) Try and explain, give alternative examples of data in cells (give addresses including on what sheet), what you want before and after double clicking. Also what sheet is the event code run in. Regards, Peter T "niailmar" wrote in message ... I need an expert like you to solve my problem. I have a Attendant Table for Staff, which consists of Name, Staff ID and so on. I have already create the code for “Automatic appearance of date in Column D when you Double Click the Column C of attendance column “. The code is like this: Option Explicit Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) 'Limit Target count to 1 If Target.Count 1 Then Exit Sub 'Isolate Target to a specific range If Intersect(Target, Range("CheckBoxs")) Is Nothing Then Exit Sub 'Set Target font to "marlett" Target.Font.Name = "marlett" 'Check value of target If Target.Value < "a" Then Target.Value = "a" 'Sets target Value = "a" Cancel = True Exit Sub End If If Target.Value = "a" Then Target.ClearContents 'Sets target Value = "" Cancel = True Exit Sub End If End Sub Private Sub Worksheet_Change(ByVal Target As Range) 'Limit Target count to 1 If Target.Count 1 Then Exit Sub 'Isolate Target to a specific range If Intersect(Target, Range("CheckBoxs")) Is Nothing Then Exit Sub 'Select a specific subset of the range "Ckboxes" Select Case Target.Address Case Else If Target.Value = "a" Then Target.Offset(0, 1).Value = Date Else: Target.Offset(0, 1).Value = "" End If End Select Name and staff id already available in sheet2. Sheet2 is the database that will be store all the information. Date that will captured is current date(today date) when double click the Column C of attendance column then date will appear. I will clicking in the row at attendance column. The tick is create by using marlett function. You can refer the coding above.The action should be done is like this, if sheet2 have similar name and staff id like in sheet1 then date is should copy or ??? in sheet2 (column date) I hope you can help me bout this problem. I attach an image to clear what I need. I appreciate your help. -- niailmar |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I capture a date? | Excel Discussion (Misc queries) | |||
Marlett font | Excel Discussion (Misc queries) | |||
How do I capture info from multiple sheets to main worksheet? | Excel Discussion (Misc queries) | |||
Capture date for =MAX(a1:a250) formula | Excel Programming | |||
want to capture date | Excel Discussion (Misc queries) |