메인 컨텐츠로 가기

셀을 클릭하여 셀 값을 변경하는 방법은 무엇입니까?

Excel에서 셀을 클릭하여 셀 값을 변경할 수 있습니까? 예를 들어 특정 셀 A1을 처음 클릭하면 "Excel"이라는 텍스트가 표시되고 A1을 다시 클릭하면 "Word"라는 텍스트가 표시되고이를 클릭하면 "Outlook"이라는 텍스트가 표시됩니다. 세 번째로 세포. 이 경우 A1 셀의 값은 다음 스크린 샷과 같이 "Excel"에서 "Word", "Outlook", "Excel"……으로 반복됩니다.

클릭하여 문서 변경 값 1

VBA 코드가있는 셀을 클릭하여 셀 값 변경


화살표 블루 오른쪽 거품 VBA 코드가있는 셀을 클릭하여 셀 값 변경

Excel에서이 작업을 완료하려면 다음 VBA 코드가 도움이 될 수 있습니다. 다음과 같이하십시오.

1. 클릭하여 셀 값을 변경하려는 시트 탭을 마우스 오른쪽 단추로 클릭하고 코드보기 상황에 맞는 메뉴 및 열린 응용 프로그램 용 Microsoft Visual Basic 창에서 다음 코드를 복사하여 빈 모듈에 붙여 넣습니다.

VBA 코드 : 셀을 클릭하여 셀 값 변경 :

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
'Updateby Extendoffice
  Application.EnableEvents = False
  With Target
  If .Address = Range("A1").Address Then
    Select Case .Value
      Case "Excel"
        .Value = "Word"
      Case "Word"
        .Value = "Outlook"
      Case "Outlook"
        .Value = "Excel"
      Case Else
        .Value = "Word"
    End Select
  End If
  End With
  Range("A2").Select
  Application.EnableEvents = True
End Sub

클릭하여 문서 변경 값 2

주의 사항: 위 코드에서 A1 "을 클릭하여 값을 변경하려는 셀입니다.뛰어나다","워드","Outlook”는 반복적으로 표시하려는 셀 값이며 필요에 따라 변경할 수 있습니다.

2. 코드를 붙여 넣은 후 코드를 저장하고 창을 닫습니다. 이제 A1 셀을 처음 클릭하면“Excel”이라는 텍스트가 한 번에 표시되고 다시 클릭하면“Word”라는 텍스트가 나타나고 세 번째로 클릭하면“Outlook”이라는 텍스트가 표시됩니다. 스크린 샷 참조 :

클릭하여 문서 변경 값 1


더 많은 관련 기사 :

Excel에서 셀 내용을 클릭하여 데이터를 필터링하는 방법은 무엇입니까?

Excel에서 헤더를 클릭하여 열 데이터를 정렬하는 방법은 무엇입니까?

최고의 사무 생산성 도구

🤖 Kutools AI 보좌관: 다음을 기반으로 데이터 분석을 혁신합니다. 지능형 실행   |  코드 생성  |  사용자 정의 수식 만들기  |  데이터 분석 및 차트 생성  |  Kutools 기능 호출...
인기 기능: 중복 항목 찾기, 강조 표시 또는 식별   |  빈 행 삭제   |  데이터 손실 없이 열이나 셀 결합   |   수식없이 반올림 ...
슈퍼 조회: 다중 기준 VLookup    다중 값 VLookup  |   여러 시트에 걸친 VLookup   |   퍼지 조회 ....
고급 드롭다운 목록: 드롭다운 목록을 빠르게 생성   |  종속 드롭다운 목록   |  다중 선택 드롭 다운 목록 ....
열 관리자: 특정 개수의 열 추가  |  열 이동  |  Toggle 숨겨진 열의 가시성 상태  |  범위 및 열 비교 ...
특색 지어진 특징: 그리드 포커스   |  디자인보기   |   큰 수식 바    통합 문서 및 시트 관리자   |  리소스 라이브러리 (자동 텍스트)   |  날짜 선택기   |  워크 시트 결합   |  셀 암호화/해독    목록으로 이메일 보내기   |  슈퍼 필터   |   특수 필터 (굵게/기울임꼴/취소선 필터링...) ...
상위 15개 도구 세트12 본문 도구 (텍스트 추가, 문자 제거,...)   |   50+ 거래차트 유형 (Gantt 차트,...)   |   40+ 실용 방식 (생일을 기준으로 나이 계산,...)   |   19 삽입 도구 (QR 코드 삽입, 경로에서 그림 삽입,...)   |   12 매출 상승 도구 (숫자를 단어로, 환율,...)   |   7 병합 및 분할 도구 (고급 결합 행, 셀 분할,...)   |   ... 그리고 더

Excel용 Kutools로 Excel 기술을 강화하고 이전과는 전혀 다른 효율성을 경험해 보세요. Excel용 Kutools는 생산성을 높이고 시간을 절약하기 위해 300개 이상의 고급 기능을 제공합니다.  가장 필요한 기능을 얻으려면 여기를 클릭하십시오...

상품 설명


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

  • Word, Excel, PowerPoint에서 탭 편집 및 읽기 사용, Publisher, Access, Visio 및 Project.
  • 새 창이 아닌 동일한 창의 새 탭에서 여러 문서를 열고 만듭니다.
  • 생산성을 50% 높이고 매일 수백 번의 마우스 클릭을 줄입니다!
Comments (7)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
This is great information, thanks for everyone's input! Is there away to apply this same type of approach with a lookup or index\match value?

For example, if I click on a value in A1, can the VBA be configured to index that value in another worksheet column, and display a matched value in B1? Thank you again!
This comment was minimized by the moderator on the site
I am trying to apply this to an entire column of individual cells, not just one cell. Is this possible? When I change the range from "A1" to "A1:A100" nothing happens when I click the cells in that range.
This comment was minimized by the moderator on the site
This is the final code that worked for me.  I use it to check a cell when an item is completed.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  Application.EnableEvents = False
    With Target
      Dim KeyCells As Range
      Set KeyCells = Range("D6:D8000")
      If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
        Select Case .Value
          Case "ü"
            .Value = ""
          Case ""
            .Value = "ü"
        End Select
      End If
    End With
  Application.EnableEvents = True
End Sub
This comment was minimized by the moderator on the site
You can do that by declaring the range you want to have as KeyCells and than put that into the Application.Intersection Method. This will let you change the Value of your choice from all the cells. Worked for me but i am bad at explaining ^^


Application.EnableEvents = False
With Target


Dim KeyCells as Range

Set KeyCells = Range("A1:A100")

If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then

Select Case .Value

...
This comment was minimized by the moderator on the site
You can do that by declaring the range you want to have as KeyCells and than put that into the Application.Intersection Method. This will let you change the Value of your choice from all the cells. Worked for me but i am bad at explaining ^^

Dim KeyCells as Range

Set KeyCells = Range("A1:A100")

If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then

Select Case .Value

...
This comment was minimized by the moderator on the site
I did it but i will not tell anyone MUWAHAHAHAHAHAHAHAHAHA
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations