If A1 changes, put something into B1 | If A2 changes, put something into B2How to add a button programmatically in VBA next to some sheet cell data?How to put query results into a datatable with Excel VBA and ADO?Worksheet change target + sortingExcel VBA to call a single macro by mutliple independent worksheet changesColumn looping in Worksheet Change EventUsing Excel to return a value based on 3 variablesExcel/VBA: When cell changes, change another cell with different date formatChange cell colour where vba has changed the value VBAExcel VBA - Separating elements of a 1D array by fixed widthChanging Range(“blah”).Value in a row loop

Is the "spacetime" the same thing as the mathematical 4th dimension?

Bothered by watching coworkers slacking off

What's the global, general word that stands for "center tone of a song"?

Giving a good fancy look to a simple table

Does the 'java' command compile Java programs?

Could Boris Johnson face criminal charges for illegally proroguing Parliament?

Caro-Kann c4-c5 push

Can a passenger predict that an airline or a tour operator is about to go bankrupt?

What action is recommended if your accommodation refuses to let you leave without paying additional fees?

How to "Start as close to the end as possible", and why to do so?

Looking for circuit board material that can be dissolved

Garage door sticks on a bolt

Why do Russians sometimes spell "жирный" (fatty) as "жырный"?

Does the US Armed Forces refuse to recruit anyone with an IQ less than 83?

The answer is a girl's name (my future granddaughter) - can anyone help?

If I travelled back in time to invest in X company to make a fortune, roughly what is the probability that it would fail?

Why Should I Care That Fully Meshed Peering Leads to Exponential Growth of Total Connections?

Can I bring this power bank on board the aircraft?

What does a textbook look like while you are writing it?

Knights and Knaves: What does C say?

Why has Speaker Pelosi been so hesitant to impeach President Trump?

Can I cast Death Ward on additional creatures without causing previous castings to end?

Is "weekend warrior" derogatory?

Phonetic distortion when words are borrowed among languages



If A1 changes, put something into B1 | If A2 changes, put something into B2


How to add a button programmatically in VBA next to some sheet cell data?How to put query results into a datatable with Excel VBA and ADO?Worksheet change target + sortingExcel VBA to call a single macro by mutliple independent worksheet changesColumn looping in Worksheet Change EventUsing Excel to return a value based on 3 variablesExcel/VBA: When cell changes, change another cell with different date formatChange cell colour where vba has changed the value VBAExcel VBA - Separating elements of a 1D array by fixed widthChanging Range(“blah”).Value in a row loop






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









-1















I have rows from 1-100.
I know how to target specific cells and get data from them, but how would I do this when any row from 1 to 100 can be changed?



Say you put anything into Row A3. How would you write "Updated" into row B3 via VBA?
I want this to apply to rows A1-A100.



Thanks










share|improve this question





















  • 5





    Look into the Worksheet_Change event. Here and here are links to get you started.

    – tigeravatar
    Mar 28 at 20:49











  • Thanks, I'm looking into it.

    – pufAmuf
    Mar 28 at 20:53

















-1















I have rows from 1-100.
I know how to target specific cells and get data from them, but how would I do this when any row from 1 to 100 can be changed?



Say you put anything into Row A3. How would you write "Updated" into row B3 via VBA?
I want this to apply to rows A1-A100.



Thanks










share|improve this question





















  • 5





    Look into the Worksheet_Change event. Here and here are links to get you started.

    – tigeravatar
    Mar 28 at 20:49











  • Thanks, I'm looking into it.

    – pufAmuf
    Mar 28 at 20:53













-1












-1








-1








I have rows from 1-100.
I know how to target specific cells and get data from them, but how would I do this when any row from 1 to 100 can be changed?



Say you put anything into Row A3. How would you write "Updated" into row B3 via VBA?
I want this to apply to rows A1-A100.



Thanks










share|improve this question
















I have rows from 1-100.
I know how to target specific cells and get data from them, but how would I do this when any row from 1 to 100 can be changed?



Say you put anything into Row A3. How would you write "Updated" into row B3 via VBA?
I want this to apply to rows A1-A100.



Thanks







excel vba






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 21:28









Mathieu Guindon

52.1k8 gold badges76 silver badges172 bronze badges




52.1k8 gold badges76 silver badges172 bronze badges










asked Mar 28 at 20:46









pufAmufpufAmuf

2,2279 gold badges50 silver badges86 bronze badges




2,2279 gold badges50 silver badges86 bronze badges










  • 5





    Look into the Worksheet_Change event. Here and here are links to get you started.

    – tigeravatar
    Mar 28 at 20:49











  • Thanks, I'm looking into it.

    – pufAmuf
    Mar 28 at 20:53












  • 5





    Look into the Worksheet_Change event. Here and here are links to get you started.

    – tigeravatar
    Mar 28 at 20:49











  • Thanks, I'm looking into it.

    – pufAmuf
    Mar 28 at 20:53







5




5





Look into the Worksheet_Change event. Here and here are links to get you started.

– tigeravatar
Mar 28 at 20:49





Look into the Worksheet_Change event. Here and here are links to get you started.

– tigeravatar
Mar 28 at 20:49













Thanks, I'm looking into it.

– pufAmuf
Mar 28 at 20:53





Thanks, I'm looking into it.

– pufAmuf
Mar 28 at 20:53












2 Answers
2






active

oldest

votes


















2
















Place the following event macro in the worksheet code area:



Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range, Intersection As Range, Cell As Range

Set A = Range("A1:A100")
Set Intersection = Intersect(Target, A)
If Intersection Is Nothing Then Exit Sub

Application.EnableEvents = False
For Each Cell In Intersection
Cell.Offset(0, 1).Value = "Updated"
Next Cell
Application.EnableEvents = True
End Sub





share|improve this answer
































    1
















    1. Open VBA Editor

    2. Double click on the sheet you event take action (sheets appears in the left top box)

    3. Select Worksheet on the left box above code box

    4. Select change on the right box above code box


    5. Paste the code



      Option Explicit

      Private Sub Worksheet_Change(ByVal Target As Range)

      With ThisWorkbook.Worksheets("Sheet1")

      If Not Intersect(Target, .Range("A1:A100")) Is Nothing Then

      Application.EnableEvents = False
      .Range("B" & Target.Row).Value = "Updated"
      Application.EnableEvents = True
      End If

      End With

      End Sub






    share|improve this answer


























      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );














      draft saved

      draft discarded
















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406603%2fif-a1-changes-put-something-into-b1-if-a2-changes-put-something-into-b2%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2
















      Place the following event macro in the worksheet code area:



      Private Sub Worksheet_Change(ByVal Target As Range)
      Dim A As Range, Intersection As Range, Cell As Range

      Set A = Range("A1:A100")
      Set Intersection = Intersect(Target, A)
      If Intersection Is Nothing Then Exit Sub

      Application.EnableEvents = False
      For Each Cell In Intersection
      Cell.Offset(0, 1).Value = "Updated"
      Next Cell
      Application.EnableEvents = True
      End Sub





      share|improve this answer





























        2
















        Place the following event macro in the worksheet code area:



        Private Sub Worksheet_Change(ByVal Target As Range)
        Dim A As Range, Intersection As Range, Cell As Range

        Set A = Range("A1:A100")
        Set Intersection = Intersect(Target, A)
        If Intersection Is Nothing Then Exit Sub

        Application.EnableEvents = False
        For Each Cell In Intersection
        Cell.Offset(0, 1).Value = "Updated"
        Next Cell
        Application.EnableEvents = True
        End Sub





        share|improve this answer



























          2














          2










          2









          Place the following event macro in the worksheet code area:



          Private Sub Worksheet_Change(ByVal Target As Range)
          Dim A As Range, Intersection As Range, Cell As Range

          Set A = Range("A1:A100")
          Set Intersection = Intersect(Target, A)
          If Intersection Is Nothing Then Exit Sub

          Application.EnableEvents = False
          For Each Cell In Intersection
          Cell.Offset(0, 1).Value = "Updated"
          Next Cell
          Application.EnableEvents = True
          End Sub





          share|improve this answer













          Place the following event macro in the worksheet code area:



          Private Sub Worksheet_Change(ByVal Target As Range)
          Dim A As Range, Intersection As Range, Cell As Range

          Set A = Range("A1:A100")
          Set Intersection = Intersect(Target, A)
          If Intersection Is Nothing Then Exit Sub

          Application.EnableEvents = False
          For Each Cell In Intersection
          Cell.Offset(0, 1).Value = "Updated"
          Next Cell
          Application.EnableEvents = True
          End Sub






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 28 at 21:58









          Gary's StudentGary's Student

          78.5k9 gold badges43 silver badges67 bronze badges




          78.5k9 gold badges43 silver badges67 bronze badges


























              1
















              1. Open VBA Editor

              2. Double click on the sheet you event take action (sheets appears in the left top box)

              3. Select Worksheet on the left box above code box

              4. Select change on the right box above code box


              5. Paste the code



                Option Explicit

                Private Sub Worksheet_Change(ByVal Target As Range)

                With ThisWorkbook.Worksheets("Sheet1")

                If Not Intersect(Target, .Range("A1:A100")) Is Nothing Then

                Application.EnableEvents = False
                .Range("B" & Target.Row).Value = "Updated"
                Application.EnableEvents = True
                End If

                End With

                End Sub






              share|improve this answer





























                1
















                1. Open VBA Editor

                2. Double click on the sheet you event take action (sheets appears in the left top box)

                3. Select Worksheet on the left box above code box

                4. Select change on the right box above code box


                5. Paste the code



                  Option Explicit

                  Private Sub Worksheet_Change(ByVal Target As Range)

                  With ThisWorkbook.Worksheets("Sheet1")

                  If Not Intersect(Target, .Range("A1:A100")) Is Nothing Then

                  Application.EnableEvents = False
                  .Range("B" & Target.Row).Value = "Updated"
                  Application.EnableEvents = True
                  End If

                  End With

                  End Sub






                share|improve this answer



























                  1














                  1










                  1









                  1. Open VBA Editor

                  2. Double click on the sheet you event take action (sheets appears in the left top box)

                  3. Select Worksheet on the left box above code box

                  4. Select change on the right box above code box


                  5. Paste the code



                    Option Explicit

                    Private Sub Worksheet_Change(ByVal Target As Range)

                    With ThisWorkbook.Worksheets("Sheet1")

                    If Not Intersect(Target, .Range("A1:A100")) Is Nothing Then

                    Application.EnableEvents = False
                    .Range("B" & Target.Row).Value = "Updated"
                    Application.EnableEvents = True
                    End If

                    End With

                    End Sub






                  share|improve this answer













                  1. Open VBA Editor

                  2. Double click on the sheet you event take action (sheets appears in the left top box)

                  3. Select Worksheet on the left box above code box

                  4. Select change on the right box above code box


                  5. Paste the code



                    Option Explicit

                    Private Sub Worksheet_Change(ByVal Target As Range)

                    With ThisWorkbook.Worksheets("Sheet1")

                    If Not Intersect(Target, .Range("A1:A100")) Is Nothing Then

                    Application.EnableEvents = False
                    .Range("B" & Target.Row).Value = "Updated"
                    Application.EnableEvents = True
                    End If

                    End With

                    End Sub







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 28 at 22:07









                  Error 1004Error 1004

                  5,6032 gold badges10 silver badges26 bronze badges




                  5,6032 gold badges10 silver badges26 bronze badges































                      draft saved

                      draft discarded















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406603%2fif-a1-changes-put-something-into-b1-if-a2-changes-put-something-into-b2%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                      SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                      은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현