Writing to cell D27 is not updating to a value The 2019 Stack Overflow Developer Survey Results Are InCleaning up and reformatting imported data in an Excel sheetStandard Methods in VBAAggregating data from multiple worksheets into a consistent formatInterpolating data of multiple trainsEliminating empty spreadsheet cells from a rangeMaking a report from payroll detailsMirror and update cells across tabs and formsClass to update a userform with an external workbook and vice versaChecking cell-by-cell, updating several workbooksHow to return cell values of a non-sequential set of cells from multiple closed spreadsheets? Code condensing/simplification
JSON.serialize: is it possible to suppress null values of a map?
How can I fix this gap between bookcases I made?
Are there any other methods to apply to solving simultaneous equations?
Access elements in std::string where positon of string is greater than its size
Does a dangling wire really electrocute me if I'm standing in water?
Does it makes sense to buy a new cycle to learn riding?
What does "rabbited" mean/imply in this sentence?
It's possible to achieve negative score?
"What time...?" or "At what time...?" - what is more grammatically correct?
Is flight data recorder erased after every flight?
Is there a name of the flying bionic bird?
Dual Citizen. Exited the US on Italian passport recently
How are circuits which use complex ICs normally simulated?
Is "plugging out" electronic devices an American expression?
Carnot-Caratheodory metric
Does light intensity oscillate really fast since it is a wave?
What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?
Why is it "Tumoren" and not "Tumore"?
Lethal sonic weapons
Is it worth rebuilding a wheel myself to save money?
How was Skylab's orbit inclination chosen?
On the insanity of kings as an argument against Monarchy
is usb on wall sockets live all the time with out switches off
Can I write a for loop that iterates over both collections and arrays?
Writing to cell D27 is not updating to a value
The 2019 Stack Overflow Developer Survey Results Are InCleaning up and reformatting imported data in an Excel sheetStandard Methods in VBAAggregating data from multiple worksheets into a consistent formatInterpolating data of multiple trainsEliminating empty spreadsheet cells from a rangeMaking a report from payroll detailsMirror and update cells across tabs and formsClass to update a userform with an external workbook and vice versaChecking cell-by-cell, updating several workbooksHow to return cell values of a non-sequential set of cells from multiple closed spreadsheets? Code condensing/simplification
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
I am reading in the inputs from cell D24 and E24, then attempting to update cell D27, based off of the input I make in cell E24(1, 2, neither). Why is my code compiling correctly, but not outputting the correct value? I completed a debug and my "z" variable has the correct value, but it's not writing the value to the cell.
Sub UpdateD_27()
Dim x As Integer 'Declare variable for Starting Value
Dim y As Integer 'Declare variable for Choice/Editable Value
Dim z As Integer 'Declare variable for Answer
Dim m As String 'Declare variable for Message to User
x = ActiveWorkbook.Sheets("TabF").Range("D24").Value 'Set variable in memory storage location
y = ActiveWorkbook.Sheets("TabF").Range("E24").Value 'Set variable in memory storage location
z = ActiveWorkbook.Sheets("TabF").Range("D28").Value 'Set variable in memory storage location
If (y = 1) Then
z = x * 7
ElseIf (y = 2) Then
z = x / 7
Else
m = "Please enter the value 1 or 2 in cell E24."
End If
End Sub
vba excel
New contributor
Tanner10 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
add a comment |
$begingroup$
I am reading in the inputs from cell D24 and E24, then attempting to update cell D27, based off of the input I make in cell E24(1, 2, neither). Why is my code compiling correctly, but not outputting the correct value? I completed a debug and my "z" variable has the correct value, but it's not writing the value to the cell.
Sub UpdateD_27()
Dim x As Integer 'Declare variable for Starting Value
Dim y As Integer 'Declare variable for Choice/Editable Value
Dim z As Integer 'Declare variable for Answer
Dim m As String 'Declare variable for Message to User
x = ActiveWorkbook.Sheets("TabF").Range("D24").Value 'Set variable in memory storage location
y = ActiveWorkbook.Sheets("TabF").Range("E24").Value 'Set variable in memory storage location
z = ActiveWorkbook.Sheets("TabF").Range("D28").Value 'Set variable in memory storage location
If (y = 1) Then
z = x * 7
ElseIf (y = 2) Then
z = x / 7
Else
m = "Please enter the value 1 or 2 in cell E24."
End If
End Sub
vba excel
New contributor
Tanner10 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
$begingroup$
Part of CodeReview is the requirement that must contain code that is already working correctly. You'll need to edit your question to fulfill this requirement. CodeReview is about already working code. If you can't then you may want to look at StackOveflow and review their rules regarding asking question.
$endgroup$
– IvenBach
2 mins ago
add a comment |
$begingroup$
I am reading in the inputs from cell D24 and E24, then attempting to update cell D27, based off of the input I make in cell E24(1, 2, neither). Why is my code compiling correctly, but not outputting the correct value? I completed a debug and my "z" variable has the correct value, but it's not writing the value to the cell.
Sub UpdateD_27()
Dim x As Integer 'Declare variable for Starting Value
Dim y As Integer 'Declare variable for Choice/Editable Value
Dim z As Integer 'Declare variable for Answer
Dim m As String 'Declare variable for Message to User
x = ActiveWorkbook.Sheets("TabF").Range("D24").Value 'Set variable in memory storage location
y = ActiveWorkbook.Sheets("TabF").Range("E24").Value 'Set variable in memory storage location
z = ActiveWorkbook.Sheets("TabF").Range("D28").Value 'Set variable in memory storage location
If (y = 1) Then
z = x * 7
ElseIf (y = 2) Then
z = x / 7
Else
m = "Please enter the value 1 or 2 in cell E24."
End If
End Sub
vba excel
New contributor
Tanner10 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
I am reading in the inputs from cell D24 and E24, then attempting to update cell D27, based off of the input I make in cell E24(1, 2, neither). Why is my code compiling correctly, but not outputting the correct value? I completed a debug and my "z" variable has the correct value, but it's not writing the value to the cell.
Sub UpdateD_27()
Dim x As Integer 'Declare variable for Starting Value
Dim y As Integer 'Declare variable for Choice/Editable Value
Dim z As Integer 'Declare variable for Answer
Dim m As String 'Declare variable for Message to User
x = ActiveWorkbook.Sheets("TabF").Range("D24").Value 'Set variable in memory storage location
y = ActiveWorkbook.Sheets("TabF").Range("E24").Value 'Set variable in memory storage location
z = ActiveWorkbook.Sheets("TabF").Range("D28").Value 'Set variable in memory storage location
If (y = 1) Then
z = x * 7
ElseIf (y = 2) Then
z = x / 7
Else
m = "Please enter the value 1 or 2 in cell E24."
End If
End Sub
vba excel
vba excel
New contributor
Tanner10 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Tanner10 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Tanner10 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 16 mins ago
Tanner10Tanner10
1
1
New contributor
Tanner10 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Tanner10 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Tanner10 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$begingroup$
Part of CodeReview is the requirement that must contain code that is already working correctly. You'll need to edit your question to fulfill this requirement. CodeReview is about already working code. If you can't then you may want to look at StackOveflow and review their rules regarding asking question.
$endgroup$
– IvenBach
2 mins ago
add a comment |
$begingroup$
Part of CodeReview is the requirement that must contain code that is already working correctly. You'll need to edit your question to fulfill this requirement. CodeReview is about already working code. If you can't then you may want to look at StackOveflow and review their rules regarding asking question.
$endgroup$
– IvenBach
2 mins ago
$begingroup$
Part of CodeReview is the requirement that must contain code that is already working correctly. You'll need to edit your question to fulfill this requirement. CodeReview is about already working code. If you can't then you may want to look at StackOveflow and review their rules regarding asking question.
$endgroup$
– IvenBach
2 mins ago
$begingroup$
Part of CodeReview is the requirement that must contain code that is already working correctly. You'll need to edit your question to fulfill this requirement. CodeReview is about already working code. If you can't then you may want to look at StackOveflow and review their rules regarding asking question.
$endgroup$
– IvenBach
2 mins ago
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
);
);
, "mathjax-editing");
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: "196"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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
);
);
Tanner10 is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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%2fcodereview.stackexchange.com%2fquestions%2f217159%2fwriting-to-cell-d27-is-not-updating-to-a-value%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
Tanner10 is a new contributor. Be nice, and check out our Code of Conduct.
Tanner10 is a new contributor. Be nice, and check out our Code of Conduct.
Tanner10 is a new contributor. Be nice, and check out our Code of Conduct.
Tanner10 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Code Review Stack Exchange!
- 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.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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%2fcodereview.stackexchange.com%2fquestions%2f217159%2fwriting-to-cell-d27-is-not-updating-to-a-value%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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
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
$begingroup$
Part of CodeReview is the requirement that must contain code that is already working correctly. You'll need to edit your question to fulfill this requirement. CodeReview is about already working code. If you can't then you may want to look at StackOveflow and review their rules regarding asking question.
$endgroup$
– IvenBach
2 mins ago