Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7914427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:06:43+00:00 2026-06-03T14:06:43+00:00

I am trying to use the Worksheet Change Event in Excel VBA, but it

  • 0

I am trying to use the Worksheet Change Event in Excel VBA, but it doesn’t seem to work.

From what I gather, it is enough to just define the handling function “Worksheet_Change” as I have done here:

Private Sub Worksheet_Change(ByVal Target As Range)
    Range("J1").Select
    If Target.Address = "$J$1" And ActiveCell.Value = 1 Then
        Range("B1").Select
        Dim c As Integer
        c = ActiveCell.Value
        c = c + 1
       ActiveCell.Value = c
    End If
End Sub

The problem is that I am not sure exactly where I am supposed to define it. I have just put it in “module1” which was automatically generated when I made my first macro. Is this correct? I am quite new to VBA, so I don’t know much about it yet.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:06:44+00:00Added an answer on June 3, 2026 at 2:06 pm

    You need to put it in the sheet that it applies to. In other words, if you want to capture change events on Sheet1, in the VBA editor, you need to put it in VBAProject (Book_Name) > Microsoft Excel Objects > Sheet1.

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I program in Excel-VBA I use Hungarian notation. Worksheet variables start with ws,
All, I'm trying to use vlookup in a simple VBA function, but it is
I'm new to VBA but I'm trying to get a DYMO LabelWriter to work
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
Trying to use Powershell to script the removal of specific custom errors from an
I'm trying to use ActiveSheet.CustomProperties to temporarily store my macro's settings for each worksheet.
I'm trying to use IronPython to export a series of Excel Worksheets to delimited
I am trying to evaluate Excel DNA to use it in one of my
I am trying to use openxml to produce automated excel files. One problem I
I am trying to add a new worksheet to an Excel workbook and make

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.