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

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현