Loop skips first number of the countSkip to next step if cancel is pressed in InputBoxEXCEL VBA InputBox Ok/CancelVBA: Store value to variableExcel VBA - read cell value from codeExcel Find a sheet based on namecheck is user select data from first or other columnsexcel macro to create new row for number diffImporting TXT to excel whilst skipping first 7 characters and moving to the next colomn after each fileExcel-VBA loop ifsExcel VBA. How to count isolated number series
Why do Klingons use cloaking devices?
Why would "dead languages" be the only languages that spells could be written in?
What is the maximum amount of diamond in one Minecraft game?
What is the addition in the re-released version of Avengers: Endgame?
What does the ash content of broken wheat really mean?
How can I effectively map a multi-level dungeon?
Is it possible that Curiosity measured its own methane or failed doing the spectrometry?
CPA filed late returns, stating I would get money; IRS says they were filed too late
What is meant by perfect, imperfect consonance and dissonance?
My players like to search everything. What do they find?
What/Where usage English vs Japanese
Has there ever been a cold war other than between the U.S. and the U.S.S.R.?
Did Stalin kill all Soviet officers involved in the Winter War?
Can a wizard delay learning new spells from leveling up to learn different spells later?
Why is the order of my features changed when using readFeatures in OpenLayers v4.6.5?
Does the Defensive Duelist feat stack with the Warforged integrated protection?
Isn't "Dave's protocol" good if only the database, and not the code, is leaked?
Park the computer
What is the difference between a historical drama and a period drama?
Should I warn my boss I might take sick leave
How come having a Deathly Hallow is not a big deal?
Chess problem: Make a crossword in 3 moves
how to convert Timestring to seconds
Why do we need a bootloader separate than our application program in MCU's?
Loop skips first number of the count
Skip to next step if cancel is pressed in InputBoxEXCEL VBA InputBox Ok/CancelVBA: Store value to variableExcel VBA - read cell value from codeExcel Find a sheet based on namecheck is user select data from first or other columnsexcel macro to create new row for number diffImporting TXT to excel whilst skipping first 7 characters and moving to the next colomn after each fileExcel-VBA loop ifsExcel VBA. How to count isolated number series
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am unsure why this is skipping what should be the next number. For example, if I input 5 the list then runs 7,8, etc, but the number 6 is dropped. Similar if I input 4 the list then runs 6,7, etc.
Sub CountFromInput()
Dim i As Integer
Dim start As Integer
start = InputBox(Prompt:="Input the first number", Title:="Number Input")
Range("b1") = start
For i = 2 To 14
Cells(i, 2).Value = start + i
Next i
End Sub
excel vba
add a comment |
I am unsure why this is skipping what should be the next number. For example, if I input 5 the list then runs 7,8, etc, but the number 6 is dropped. Similar if I input 4 the list then runs 6,7, etc.
Sub CountFromInput()
Dim i As Integer
Dim start As Integer
start = InputBox(Prompt:="Input the first number", Title:="Number Input")
Range("b1") = start
For i = 2 To 14
Cells(i, 2).Value = start + i
Next i
End Sub
excel vba
Yes, that becausei=2
and2+4
is6
. You need to start withi= 1
or is this a kind of trick question?
– Storax
Mar 25 at 18:48
No trick intended. I have i = 2 to 14 because the input box puts the initial number in row 1 and I want rows 2 to 14 filled with the concurrent numbers.
– DHPA
Mar 25 at 18:49
add a comment |
I am unsure why this is skipping what should be the next number. For example, if I input 5 the list then runs 7,8, etc, but the number 6 is dropped. Similar if I input 4 the list then runs 6,7, etc.
Sub CountFromInput()
Dim i As Integer
Dim start As Integer
start = InputBox(Prompt:="Input the first number", Title:="Number Input")
Range("b1") = start
For i = 2 To 14
Cells(i, 2).Value = start + i
Next i
End Sub
excel vba
I am unsure why this is skipping what should be the next number. For example, if I input 5 the list then runs 7,8, etc, but the number 6 is dropped. Similar if I input 4 the list then runs 6,7, etc.
Sub CountFromInput()
Dim i As Integer
Dim start As Integer
start = InputBox(Prompt:="Input the first number", Title:="Number Input")
Range("b1") = start
For i = 2 To 14
Cells(i, 2).Value = start + i
Next i
End Sub
excel vba
excel vba
edited Mar 26 at 7:25
Pᴇʜ
28.4k6 gold badges30 silver badges54 bronze badges
28.4k6 gold badges30 silver badges54 bronze badges
asked Mar 25 at 18:39
DHPADHPA
287 bronze badges
287 bronze badges
Yes, that becausei=2
and2+4
is6
. You need to start withi= 1
or is this a kind of trick question?
– Storax
Mar 25 at 18:48
No trick intended. I have i = 2 to 14 because the input box puts the initial number in row 1 and I want rows 2 to 14 filled with the concurrent numbers.
– DHPA
Mar 25 at 18:49
add a comment |
Yes, that becausei=2
and2+4
is6
. You need to start withi= 1
or is this a kind of trick question?
– Storax
Mar 25 at 18:48
No trick intended. I have i = 2 to 14 because the input box puts the initial number in row 1 and I want rows 2 to 14 filled with the concurrent numbers.
– DHPA
Mar 25 at 18:49
Yes, that because
i=2
and 2+4
is 6
. You need to start with i= 1
or is this a kind of trick question?– Storax
Mar 25 at 18:48
Yes, that because
i=2
and 2+4
is 6
. You need to start with i= 1
or is this a kind of trick question?– Storax
Mar 25 at 18:48
No trick intended. I have i = 2 to 14 because the input box puts the initial number in row 1 and I want rows 2 to 14 filled with the concurrent numbers.
– DHPA
Mar 25 at 18:49
No trick intended. I have i = 2 to 14 because the input box puts the initial number in row 1 and I want rows 2 to 14 filled with the concurrent numbers.
– DHPA
Mar 25 at 18:49
add a comment |
1 Answer
1
active
oldest
votes
Sub CountFromInput()
Dim i As Integer
Dim start As Integer
start = InputBox(Prompt:="Input the first number", Title:="Number Input")
Range("b1") = start
For i = 1 To 13
Cells(i+1, 2).Value = start + i
Next i
End Sub
That's working as expected. If I understand your changes, this started the loop count 1 row down through the use of 'i + 1' in the loop, and for this reason the count had to be changed to '1 To 13' because the '+1' needed to be account for to achieve the end goal of 14 increments.
– DHPA
Mar 25 at 18:58
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/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%2f55344462%2floop-skips-first-number-of-the-count%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sub CountFromInput()
Dim i As Integer
Dim start As Integer
start = InputBox(Prompt:="Input the first number", Title:="Number Input")
Range("b1") = start
For i = 1 To 13
Cells(i+1, 2).Value = start + i
Next i
End Sub
That's working as expected. If I understand your changes, this started the loop count 1 row down through the use of 'i + 1' in the loop, and for this reason the count had to be changed to '1 To 13' because the '+1' needed to be account for to achieve the end goal of 14 increments.
– DHPA
Mar 25 at 18:58
add a comment |
Sub CountFromInput()
Dim i As Integer
Dim start As Integer
start = InputBox(Prompt:="Input the first number", Title:="Number Input")
Range("b1") = start
For i = 1 To 13
Cells(i+1, 2).Value = start + i
Next i
End Sub
That's working as expected. If I understand your changes, this started the loop count 1 row down through the use of 'i + 1' in the loop, and for this reason the count had to be changed to '1 To 13' because the '+1' needed to be account for to achieve the end goal of 14 increments.
– DHPA
Mar 25 at 18:58
add a comment |
Sub CountFromInput()
Dim i As Integer
Dim start As Integer
start = InputBox(Prompt:="Input the first number", Title:="Number Input")
Range("b1") = start
For i = 1 To 13
Cells(i+1, 2).Value = start + i
Next i
End Sub
Sub CountFromInput()
Dim i As Integer
Dim start As Integer
start = InputBox(Prompt:="Input the first number", Title:="Number Input")
Range("b1") = start
For i = 1 To 13
Cells(i+1, 2).Value = start + i
Next i
End Sub
answered Mar 25 at 18:49
StoraxStorax
4,6083 gold badges5 silver badges19 bronze badges
4,6083 gold badges5 silver badges19 bronze badges
That's working as expected. If I understand your changes, this started the loop count 1 row down through the use of 'i + 1' in the loop, and for this reason the count had to be changed to '1 To 13' because the '+1' needed to be account for to achieve the end goal of 14 increments.
– DHPA
Mar 25 at 18:58
add a comment |
That's working as expected. If I understand your changes, this started the loop count 1 row down through the use of 'i + 1' in the loop, and for this reason the count had to be changed to '1 To 13' because the '+1' needed to be account for to achieve the end goal of 14 increments.
– DHPA
Mar 25 at 18:58
That's working as expected. If I understand your changes, this started the loop count 1 row down through the use of 'i + 1' in the loop, and for this reason the count had to be changed to '1 To 13' because the '+1' needed to be account for to achieve the end goal of 14 increments.
– DHPA
Mar 25 at 18:58
That's working as expected. If I understand your changes, this started the loop count 1 row down through the use of 'i + 1' in the loop, and for this reason the count had to be changed to '1 To 13' because the '+1' needed to be account for to achieve the end goal of 14 increments.
– DHPA
Mar 25 at 18:58
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
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%2f55344462%2floop-skips-first-number-of-the-count%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
Yes, that because
i=2
and2+4
is6
. You need to start withi= 1
or is this a kind of trick question?– Storax
Mar 25 at 18:48
No trick intended. I have i = 2 to 14 because the input box puts the initial number in row 1 and I want rows 2 to 14 filled with the concurrent numbers.
– DHPA
Mar 25 at 18:49