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;
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
add a comment
|
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
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
add a comment
|
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
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
excel vba
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
add a comment
|
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
add a comment
|
2 Answers
2
active
oldest
votes
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
add a comment
|
- Open VBA Editor
- Double click on the sheet you event take action (sheets appears in the left top box)
- Select Worksheet on the left box above code box
- Select change on the right box above code box
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
add a comment
|
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment
|
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
add a comment
|
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
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
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
add a comment
|
add a comment
|
- Open VBA Editor
- Double click on the sheet you event take action (sheets appears in the left top box)
- Select Worksheet on the left box above code box
- Select change on the right box above code box
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
add a comment
|
- Open VBA Editor
- Double click on the sheet you event take action (sheets appears in the left top box)
- Select Worksheet on the left box above code box
- Select change on the right box above code box
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
add a comment
|
- Open VBA Editor
- Double click on the sheet you event take action (sheets appears in the left top box)
- Select Worksheet on the left box above code box
- Select change on the right box above code box
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
- Open VBA Editor
- Double click on the sheet you event take action (sheets appears in the left top box)
- Select Worksheet on the left box above code box
- Select change on the right box above code box
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
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
add a comment
|
add a comment
|
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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