Moving cells between worksheets after new calculation The Next CEO of Stack OverflowLoop through a range of cells, inputting data into other cells (drop-down selections) and return the result of calculationsMove Row to another worksheet where cell equals worksheet nameFIXED: Reference an Excel Sheet Name with a variableFixing my macro to copy a range to the next blank column?VBA Query Table will not pull data into worksheet after using string for htmlInterior color of cells up to the last cell with data in a columnConditional copy Excel File-2 data to excel file-1?Take the date in one worksheet and find the same date in another worksheet column and return the cell reference for that date to use in a loopExcel VBA Copy Destination syntax with variables for Workbook/Worksheettrouble declaring a variable as a specific cell on a worksheet
Running a General Election and the European Elections together
Is wanting to ask what to write an indication that you need to change your story?
0 rank tensor vs 1D vector
Domestic-to-international connection at Orlando (MCO)
Would a grinding machine be a simple and workable propulsion system for an interplanetary spacecraft?
Can MTA send mail via a relay without being told so?
Why is my new battery behaving weirdly?
Writing differences on a blackboard
How to install OpenCV on Raspbian Stretch?
Easy to read palindrome checker
Is it ever safe to open a suspicious HTML file (e.g. email attachment)?
Does Germany produce more waste than the US?
Is micro rebar a better way to reinforce concrete than rebar?
Method for adding error messages to a dictionary given a key
A Man With a Stainless Steel Endoskeleton (like The Terminator) Fighting Cloaked Aliens Only He Can See
Is there always a complete, orthogonal set of unitary matrices?
I want to delete every two lines after 3rd lines in file contain very large number of lines :
Is there a difference between "Fahrstuhl" and "Aufzug"
Unclear about dynamic binding
Why don't programming languages automatically manage the synchronous/asynchronous problem?
Newlines in BSD sed vs gsed
Bartok - Syncopation (1): Meaning of notes in between Grand Staff
Why is quantifier elimination desirable for a given theory?
WOW air has ceased operation, can I get my tickets refunded?
Moving cells between worksheets after new calculation
The Next CEO of Stack OverflowLoop through a range of cells, inputting data into other cells (drop-down selections) and return the result of calculationsMove Row to another worksheet where cell equals worksheet nameFIXED: Reference an Excel Sheet Name with a variableFixing my macro to copy a range to the next blank column?VBA Query Table will not pull data into worksheet after using string for htmlInterior color of cells up to the last cell with data in a columnConditional copy Excel File-2 data to excel file-1?Take the date in one worksheet and find the same date in another worksheet column and return the cell reference for that date to use in a loopExcel VBA Copy Destination syntax with variables for Workbook/Worksheettrouble declaring a variable as a specific cell on a worksheet
I have found posts about how to move rows between sheets with Worksheet_Change but this of course does not help with a calculation. I cannot figure out how to use the Calculation Event properly for this. I have a worksheet for a non-profit apartment complex where the residents cannot stay for more than 5 years. I have a column that calculates how long they have been here and returns "YES" or "NO" as to whether or not they have reached the five year limit. If it returns "YES", I want their entire row to be placed in another Worksheet so that we can start the eviction process. This changes everyday so it would be most efficient if this could be automatic. Thank you for your help in advance. This is the code I have so far but it will not automatically move upon recalculation.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 17 Then
If UCase(Target.Value) = "YES" Then
Target.EntireRow.Copy Destination:=Sheets("FIVE YEAR"). _
Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
End If
If Target.Column = 22 Then
If UCase(Target.Value) = "YES" Then
Target.EntireRow.Copy Destination:=Sheets("PAST RESIDENTS"). _
Range("A" & Rows.Count).End(xlUp).Offset(1)
Target.EntireRow.Delete
End If
End If
End Sub
excel vba excel-vba
add a comment |
I have found posts about how to move rows between sheets with Worksheet_Change but this of course does not help with a calculation. I cannot figure out how to use the Calculation Event properly for this. I have a worksheet for a non-profit apartment complex where the residents cannot stay for more than 5 years. I have a column that calculates how long they have been here and returns "YES" or "NO" as to whether or not they have reached the five year limit. If it returns "YES", I want their entire row to be placed in another Worksheet so that we can start the eviction process. This changes everyday so it would be most efficient if this could be automatic. Thank you for your help in advance. This is the code I have so far but it will not automatically move upon recalculation.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 17 Then
If UCase(Target.Value) = "YES" Then
Target.EntireRow.Copy Destination:=Sheets("FIVE YEAR"). _
Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
End If
If Target.Column = 22 Then
If UCase(Target.Value) = "YES" Then
Target.EntireRow.Copy Destination:=Sheets("PAST RESIDENTS"). _
Range("A" & Rows.Count).End(xlUp).Offset(1)
Target.EntireRow.Delete
End If
End If
End Sub
excel vba excel-vba
1
You could use theWorksheet_Open
event withApplication.CalculateFullRebuild
at the start to ensure everything is up to date. Then you don't have to worry editing and deleting rows inside aWorksheet_Change
orWorksheet_Calculate
event. Or add a button to the sheet and let people click it to do the processing. I'm never a fan of putting code that modifies the workbook heavily inside events. That's a personal preference though, people do it all the time. Also not a fan of evicting folks, but that's not an Excel issue.
– Byron Wall
Jun 9 '15 at 14:25
Yea I thought about the button idea but I believe that would make duplicate entries into the second worksheet every time you clicked it because I do not want to delete the residents who have been in the first sheet. I am also not a fan of eviction but as a non-profit organization meant to help people get established in the city, you need to make room for the others who need help.
– Andrew Lachawiec
Jun 10 '15 at 14:52
Duplicates could be addressed if there is a unique ID and check for it (usingApplication.Match
or.Find
). If you have no duplicates normally, you can just runData->RemoveDuplicates
after the processing and it will clean things up. There is a VBA version of that as well so it could be automated. Ideally, you would check first, but post-processing is common also.
– Byron Wall
Jun 10 '15 at 15:07
add a comment |
I have found posts about how to move rows between sheets with Worksheet_Change but this of course does not help with a calculation. I cannot figure out how to use the Calculation Event properly for this. I have a worksheet for a non-profit apartment complex where the residents cannot stay for more than 5 years. I have a column that calculates how long they have been here and returns "YES" or "NO" as to whether or not they have reached the five year limit. If it returns "YES", I want their entire row to be placed in another Worksheet so that we can start the eviction process. This changes everyday so it would be most efficient if this could be automatic. Thank you for your help in advance. This is the code I have so far but it will not automatically move upon recalculation.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 17 Then
If UCase(Target.Value) = "YES" Then
Target.EntireRow.Copy Destination:=Sheets("FIVE YEAR"). _
Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
End If
If Target.Column = 22 Then
If UCase(Target.Value) = "YES" Then
Target.EntireRow.Copy Destination:=Sheets("PAST RESIDENTS"). _
Range("A" & Rows.Count).End(xlUp).Offset(1)
Target.EntireRow.Delete
End If
End If
End Sub
excel vba excel-vba
I have found posts about how to move rows between sheets with Worksheet_Change but this of course does not help with a calculation. I cannot figure out how to use the Calculation Event properly for this. I have a worksheet for a non-profit apartment complex where the residents cannot stay for more than 5 years. I have a column that calculates how long they have been here and returns "YES" or "NO" as to whether or not they have reached the five year limit. If it returns "YES", I want their entire row to be placed in another Worksheet so that we can start the eviction process. This changes everyday so it would be most efficient if this could be automatic. Thank you for your help in advance. This is the code I have so far but it will not automatically move upon recalculation.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 17 Then
If UCase(Target.Value) = "YES" Then
Target.EntireRow.Copy Destination:=Sheets("FIVE YEAR"). _
Range("A" & Rows.Count).End(xlUp).Offset(1)
End If
End If
If Target.Column = 22 Then
If UCase(Target.Value) = "YES" Then
Target.EntireRow.Copy Destination:=Sheets("PAST RESIDENTS"). _
Range("A" & Rows.Count).End(xlUp).Offset(1)
Target.EntireRow.Delete
End If
End If
End Sub
excel vba excel-vba
excel vba excel-vba
edited Mar 7 at 16:40
Cœur
19.1k9114155
19.1k9114155
asked Jun 9 '15 at 12:44
Andrew LachawiecAndrew Lachawiec
11
11
1
You could use theWorksheet_Open
event withApplication.CalculateFullRebuild
at the start to ensure everything is up to date. Then you don't have to worry editing and deleting rows inside aWorksheet_Change
orWorksheet_Calculate
event. Or add a button to the sheet and let people click it to do the processing. I'm never a fan of putting code that modifies the workbook heavily inside events. That's a personal preference though, people do it all the time. Also not a fan of evicting folks, but that's not an Excel issue.
– Byron Wall
Jun 9 '15 at 14:25
Yea I thought about the button idea but I believe that would make duplicate entries into the second worksheet every time you clicked it because I do not want to delete the residents who have been in the first sheet. I am also not a fan of eviction but as a non-profit organization meant to help people get established in the city, you need to make room for the others who need help.
– Andrew Lachawiec
Jun 10 '15 at 14:52
Duplicates could be addressed if there is a unique ID and check for it (usingApplication.Match
or.Find
). If you have no duplicates normally, you can just runData->RemoveDuplicates
after the processing and it will clean things up. There is a VBA version of that as well so it could be automated. Ideally, you would check first, but post-processing is common also.
– Byron Wall
Jun 10 '15 at 15:07
add a comment |
1
You could use theWorksheet_Open
event withApplication.CalculateFullRebuild
at the start to ensure everything is up to date. Then you don't have to worry editing and deleting rows inside aWorksheet_Change
orWorksheet_Calculate
event. Or add a button to the sheet and let people click it to do the processing. I'm never a fan of putting code that modifies the workbook heavily inside events. That's a personal preference though, people do it all the time. Also not a fan of evicting folks, but that's not an Excel issue.
– Byron Wall
Jun 9 '15 at 14:25
Yea I thought about the button idea but I believe that would make duplicate entries into the second worksheet every time you clicked it because I do not want to delete the residents who have been in the first sheet. I am also not a fan of eviction but as a non-profit organization meant to help people get established in the city, you need to make room for the others who need help.
– Andrew Lachawiec
Jun 10 '15 at 14:52
Duplicates could be addressed if there is a unique ID and check for it (usingApplication.Match
or.Find
). If you have no duplicates normally, you can just runData->RemoveDuplicates
after the processing and it will clean things up. There is a VBA version of that as well so it could be automated. Ideally, you would check first, but post-processing is common also.
– Byron Wall
Jun 10 '15 at 15:07
1
1
You could use the
Worksheet_Open
event with Application.CalculateFullRebuild
at the start to ensure everything is up to date. Then you don't have to worry editing and deleting rows inside a Worksheet_Change
or Worksheet_Calculate
event. Or add a button to the sheet and let people click it to do the processing. I'm never a fan of putting code that modifies the workbook heavily inside events. That's a personal preference though, people do it all the time. Also not a fan of evicting folks, but that's not an Excel issue.– Byron Wall
Jun 9 '15 at 14:25
You could use the
Worksheet_Open
event with Application.CalculateFullRebuild
at the start to ensure everything is up to date. Then you don't have to worry editing and deleting rows inside a Worksheet_Change
or Worksheet_Calculate
event. Or add a button to the sheet and let people click it to do the processing. I'm never a fan of putting code that modifies the workbook heavily inside events. That's a personal preference though, people do it all the time. Also not a fan of evicting folks, but that's not an Excel issue.– Byron Wall
Jun 9 '15 at 14:25
Yea I thought about the button idea but I believe that would make duplicate entries into the second worksheet every time you clicked it because I do not want to delete the residents who have been in the first sheet. I am also not a fan of eviction but as a non-profit organization meant to help people get established in the city, you need to make room for the others who need help.
– Andrew Lachawiec
Jun 10 '15 at 14:52
Yea I thought about the button idea but I believe that would make duplicate entries into the second worksheet every time you clicked it because I do not want to delete the residents who have been in the first sheet. I am also not a fan of eviction but as a non-profit organization meant to help people get established in the city, you need to make room for the others who need help.
– Andrew Lachawiec
Jun 10 '15 at 14:52
Duplicates could be addressed if there is a unique ID and check for it (using
Application.Match
or .Find
). If you have no duplicates normally, you can just run Data->RemoveDuplicates
after the processing and it will clean things up. There is a VBA version of that as well so it could be automated. Ideally, you would check first, but post-processing is common also.– Byron Wall
Jun 10 '15 at 15:07
Duplicates could be addressed if there is a unique ID and check for it (using
Application.Match
or .Find
). If you have no duplicates normally, you can just run Data->RemoveDuplicates
after the processing and it will clean things up. There is a VBA version of that as well so it could be automated. Ideally, you would check first, but post-processing is common also.– Byron Wall
Jun 10 '15 at 15:07
add a comment |
0
active
oldest
votes
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/3.0/"u003ecc by-sa 3.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%2f30732400%2fmoving-cells-between-worksheets-after-new-calculation%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
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%2f30732400%2fmoving-cells-between-worksheets-after-new-calculation%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
1
You could use the
Worksheet_Open
event withApplication.CalculateFullRebuild
at the start to ensure everything is up to date. Then you don't have to worry editing and deleting rows inside aWorksheet_Change
orWorksheet_Calculate
event. Or add a button to the sheet and let people click it to do the processing. I'm never a fan of putting code that modifies the workbook heavily inside events. That's a personal preference though, people do it all the time. Also not a fan of evicting folks, but that's not an Excel issue.– Byron Wall
Jun 9 '15 at 14:25
Yea I thought about the button idea but I believe that would make duplicate entries into the second worksheet every time you clicked it because I do not want to delete the residents who have been in the first sheet. I am also not a fan of eviction but as a non-profit organization meant to help people get established in the city, you need to make room for the others who need help.
– Andrew Lachawiec
Jun 10 '15 at 14:52
Duplicates could be addressed if there is a unique ID and check for it (using
Application.Match
or.Find
). If you have no duplicates normally, you can just runData->RemoveDuplicates
after the processing and it will clean things up. There is a VBA version of that as well so it could be automated. Ideally, you would check first, but post-processing is common also.– Byron Wall
Jun 10 '15 at 15:07