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;








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









share|improve this question
























  • 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

















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









share|improve this question
























  • 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













0












0








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









share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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
















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












1 Answer
1






active

oldest

votes


















0














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





share|improve this answer























  • 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










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
);



);













draft saved

draft discarded


















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









0














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





share|improve this answer























  • 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















0














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





share|improve this answer























  • 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













0












0








0







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





share|improve this answer













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






share|improve this answer












share|improve this answer



share|improve this answer










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

















  • 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








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.



















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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

How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?