Note: The other languages of the website are Google-translated. Back to English
로그인  \/ 
x
or
x
REGISTER  \/ 
x

or

Excel에서 확인란을 선택한 경우 날짜 스탬프를 셀에 삽입하는 방법은 무엇입니까?

일반적으로 Excel에서 단축키를 사용하여 날짜 스탬프를 입력합니다. Excel의 확인란으로 날짜 스탬프를 셀에 삽입하는 것은 어떻습니까? 체크 박스를 선택하면 타임 스탬프가 지정된 셀에 자동으로 삽입됩니다. 이 기사는 당신이 그것을 해결하는 데 도움이 될 것입니다.

VBA 코드가있는 확인란을 선택한 경우 셀에 날짜 스탬프 삽입


VBA 코드가있는 확인란을 선택한 경우 셀에 날짜 스탬프 삽입


이 섹션에서는 Excel에서 확인란을 선택한 경우 날짜 스탬프를 셀에 자동으로 삽입하는 데 도움이되는 VBA 스크립트를 소개합니다. 다음과 같이하십시오.

1. 확인란을 삽입 한 후 다른 + F11 동시에 열려면 키 응용 프로그램 용 Microsoft Visual Basic 창.

2. 에서 응용 프로그램 용 Microsoft Visual Basic 창을 클릭합니다 끼워 넣다 > 모듈. 그런 다음 아래 VBA 코드를 복사하여 모듈 창에 붙여 넣으십시오.

VBA 코드 : 확인란을 선택한 경우 날짜 스탬프를 셀에 삽입

Sub CheckBox_Date_Stamp()
Dim xChk As CheckBox
Set xChk = ActiveSheet.CheckBoxes(Application.Caller)
With xChk.TopLeftCell.Offset(, 1)
    If xChk.Value = xlOff Then
        .Value = ""
    Else
       .Value = Date
    End If
End With
End Sub

3. 프레스 다른 + Q 닫는 키 응용 프로그램 용 Microsoft Visual Basic 창.

4. 확인란을 마우스 오른쪽 버튼으로 클릭하고 마이크로 할당 오른쪽 클릭 메뉴에서. 스크린 샷보기 :

5. 에서 매크로 지정 대화 상자에서 CheckBox_Date_Stamp 에서 매크로 이름 상자를 클릭 한 다음 OK 단추. 스크린 샷보기 :

확인란을 선택하면 날짜 스탬프가 인접한 셀에 자동으로 삽입됩니다.


관련 기사:


최고의 사무 생산성 도구

Excel 용 Kutools는 대부분의 문제를 해결하고 생산성을 80 % 향상시킵니다.

  • 재사용: 빠르게 삽입 복잡한 공식, 차트 그리고 이전에 사용한 모든 것; 셀 암호화 암호로; 메일 링리스트 생성 이메일 보내기 ...
  • 슈퍼 포뮬러 바 (여러 줄의 텍스트와 수식을 쉽게 편집 할 수 있습니다.) 레이아웃 읽기 (많은 수의 셀을 쉽게 읽고 편집합니다.) 필터링 된 범위에 붙여 넣기...
  • 셀 / 행 / 열 병합 데이터 손실없이; 셀 내용 분할; 중복 행 / 열 결합... 중복 셀 방지; 범위 비교...
  • 중복 또는 고유 선택 행; 빈 행 선택 (모든 셀이 비어 있음); 슈퍼 찾기 및 퍼지 찾기 많은 통합 문서에서; 무작위 선택 ...
  • 정확한 사본 수식 참조를 변경하지 않고 여러 셀; 참조 자동 생성 여러 시트에; 글 머리 기호 삽입, 확인란 등 ...
  • 텍스트 추출, 텍스트 추가, 위치 별 제거, 공간 제거; 페이징 부분합을 만들고 인쇄합니다. 셀 내용과 주석 간 변환...
  • 슈퍼 필터 (다른 시트에 필터 구성표 저장 및 적용) 고급 정렬 월 / 주 / 일, 빈도 등 특수 필터 굵은 기울임 꼴로 ...
  • 통합 문서와 워크 시트 결합; 키 열을 기반으로 테이블 병합; 데이터를 여러 시트로 분할; xls, xlsx 및 PDF 일괄 변환...
  • 300 개 이상의 강력한 기능. Office / Excel 2007-2019 및 365를 지원합니다. 모든 언어를 지원합니다. 기업 또는 조직에 쉽게 배포 할 수 있습니다. 전체 기능 30 일 무료 평가판. 60 일 환불 보장.
kte 탭 201905

Office Tab은 Office에 탭 인터페이스를 제공하여 작업을 훨씬 쉽게 만듭니다.

  • Word, Excel, PowerPoint에서 탭 편집 및 읽기 사용, Publisher, Access, Visio 및 Project.
  • 새 창이 아닌 동일한 창의 새 탭에서 여러 문서를 열고 만듭니다.
  • 생산성을 50 % 향상시키고 매일 수백 번의 마우스 클릭을 줄입니다!
officetab 하단
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Hash · 1 years ago
    Thank you very much!! Brilliant! Thank you!
  • To post as a guest, your comment is unpublished.
    steve · 1 years ago
    I used the VBA for the checkbox time stamp, but the first two cells are not working correctly. My first check box is in A2, when I check the box, the time is posted in B1. How do I fix this?
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Hi Steve,
      Please replace the fourth line in the code with With xChk.TopLeftCell.Offset(1, 1).
  • To post as a guest, your comment is unpublished.
    Cj · 1 years ago
    hi! i can't seem to find a way where in the datestamp will be on the side of the check box. i tried changing the offset value from 0, 1 and -1. can you help me with this? thank you!
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Hi, supposing your check box is in A2 and want to output the datestamp on the right side of the check box (in this case it is B2), please change the Offset value to Offset(1, 1).
  • To post as a guest, your comment is unpublished.
    Mehpire · 2 years ago
    how do i get the date stamp to be displayed under my check box?
  • To post as a guest, your comment is unpublished.
    Amy H · 2 years ago
    Hi! Thanks for the code. It works perfectly with a lil tweaking on the offset. However, i was working on a sheet which has many many manyyy rows (~500+ rows) which contains load of check boxes and the file size grew significantly. Is there any way to reduce the size? Any alternative way to do this?

    Thanks!
    • To post as a guest, your comment is unpublished.
      crystal · 2 years ago
      Good da
      If there are lots of check boxes in rows and you want to act on all check boxes at the same time, the below VBA code can help you.
      Please copy the codes into a Module code window, go back to the worksheet and create a button (such as a Button (Form Control)), assign the macro SetAllChkChange() to the button, then click the button to run the code.

      Now all check boxes in rows of your worksheet have been activate. You can check any one of them to insert date stamp in its adjacent cell.

      Sub SetAllChkChange()
      Dim xChks
      Dim xChk As CheckBox
      Dim xI As Long
      On Error Resume Next
      Erase xArrChk
      Set xChks = ActiveSheet.CheckBoxes
      ReDim Preserve xArrChk(1 To xChks.count)
      xI = 1
      For Each xChk In xChks
      xChk.Select
      Selection.OnAction = "ObjChkChange"
      Next
      End Sub


      Sub ObjChkChange()
      Dim xChk As CheckBox
      Set xChk = ActiveSheet.CheckBoxes(Application.Caller)
      With xChk.TopLeftCell.Offset(, 1)
      If xChk.Value = xlOff Then
      .Value = ""
      Else
      .Value = Date
      End If
      End With
      End Sub
  • To post as a guest, your comment is unpublished.
    Mallory V · 3 years ago
    I copy & pasted the VBA code exactly, but on my spreadsheet, the date appears in the cell above and to the right of the check box column, not in the cell directly to the right. ?
    • To post as a guest, your comment is unpublished.
      Jacob W · 3 years ago
      This is what I did to fix that issue

      Sub CheckBox_Date_Stamp()
      Dim xChk As CheckBox
      Set xChk = ActiveSheet.CheckBoxes(Application.Caller)
      With xChk.TopLeftCell.Offset(1, 1)
      If xChk.Value = xlOff Then
      .Value = ""
      Else
      .Value = Now()
      End If
      End With
      End Sub
    • To post as a guest, your comment is unpublished.
      CW · 3 years ago
      I am also having that exact same issue. "HELP! I need somebody HELP! Not just anybody HELP! You know I need someone HELP!
      • To post as a guest, your comment is unpublished.
        Kev · 3 years ago
        I had the same issue with the date and time stamp appearing in the cell above the intended cell (using Excel 2007). I went ahead and altered the "offset" formula so that it goes over one cell AND down one cell and now the stamp is appearing where I want it: With xChk.TopLeftCell.Offset(1, 1)
        I am updating a worksheet that someone else created and didn't create the checkboxes, but it may have to do with where inside the cell the check box is placed. I got different results when I lined up the checkbox with the bottom of the cell.

        Hope that helps!
      • To post as a guest, your comment is unpublished.
        crystal · 3 years ago
        Good day,
        The code works well in my case. After checking the check box, the date will appear in the cell directly to the right. Would you provide a screenshot of your case. And which Office version do you use. Thank you.
  • To post as a guest, your comment is unpublished.
    June · 4 years ago
    HI I tried this formula and it worked only for A1 and B1 when I applied the macro to to the checkbox in A1. However, when I applied the macro to the checkbox in A2, nothing happened in B2. Also how would the formula be changed if I wanted to use this for a checklist? If column A was the checkboxes and column C was completed date.
    • To post as a guest, your comment is unpublished.
      crystal · 3 years ago
      Good Day,
      Please assign the macro individually to each checkbox.
    • To post as a guest, your comment is unpublished.
      Miriam Alfy · 3 years ago
      Hi:) you can copy the cell with the checkbox in A1 to the rest of the column. or assign the macro individually to each checkbox
  • To post as a guest, your comment is unpublished.
    Sarah T · 4 years ago
    Is there any way to do this with the date AND time? Thanks for the info either way!
    • To post as a guest, your comment is unpublished.
      crystal · 3 years ago
      Hi,
      Please apply below VBA code to add date and time.

      Sub CheckBox_Date_Stamp()
      Dim xChk As CheckBox
      Set xChk = ActiveSheet.CheckBoxes(Application.Caller)
      With xChk.TopLeftCell.Offset(, 1)
      If xChk.Value = xlOff Then
      .Value = ""
      Else
      .Value = Now()
      End If
      End With
      End Sub
    • To post as a guest, your comment is unpublished.
      Benoit T · 4 years ago
      Sub CheckBox_Date_Stamp()
      Dim xChk As CheckBox
      Set xChk = ActiveSheet.CheckBoxes(Application.Caller)
      With xChk.TopLeftCell.Offset(, 1)
      If xChk.Value = xlOff Then
      .Value = ""
      Else
      .Value = Date & " " & Time
      End If
      End With
      End Sub
  • To post as a guest, your comment is unpublished.
    Ines · 4 years ago
    Thank you, this was very helpful, I would like to note that I find it more useful to have the date stamp to the left of the check box. to do this you just change the offset to (, -1)