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;








-1












$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









share|improve this question







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

















-1












$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









share|improve this question







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













-1












-1








-1





$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









share|improve this question







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






share|improve this question







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.











share|improve this question







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.









share|improve this question




share|improve this question






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
















  • $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










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.









draft saved

draft discarded


















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.









draft saved

draft discarded


















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.




draft saved


draft discarded














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





















































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

名間水力發電廠 目录 沿革 設施 鄰近設施 註釋 外部連結 导航菜单23°50′10″N 120°42′41″E / 23.83611°N 120.71139°E / 23.83611; 120.7113923°50′10″N 120°42′41″E / 23.83611°N 120.71139°E / 23.83611; 120.71139計畫概要原始内容臺灣第一座BOT 模式開發的水力發電廠-名間水力電廠名間水力發電廠 水利署首件BOT案原始内容《小檔案》名間電廠 首座BOT水力發電廠原始内容名間電廠BOT - 經濟部水利署中區水資源局

格濟夫卡 參考資料 导航菜单51°3′40″N 34°2′21″E / 51.06111°N 34.03917°E / 51.06111; 34.03917ГезівкаПогода в селі 编辑或修订