HBN Infotech

Training – Service – Consultancy

Excel VBA Input box tutorial – How to create number series using input box

Free Online Tutorials Hub

 

Welcome to HBN Infotech Tutorials, the best online tutorials place. Here you get free online tutorials and could learn, enhance and explore something new that you have never learnt before… Also you can download Free Microsoft Office Templates.

 

Excel VBA Input box tutorial – How to create number series using input box

Copy the code below for creating number series down the rows using inputbox function:

Sub SeriesInRows()
Dim X, Y, A, B, N
X = InputBox(“Enter the Row Offset”, “(Optional) Empty cells between series”, 0)
A = InputBox(“Enter the starting number in the series”, “Starting Number”, 1)
B = InputBox(“Enter the ending number in the series”, “Ending Number”, 50)
For N = A To B
ActiveCell.Value = N
ActiveCell.Offset(X + 1, Y).Select
Next N
X = 0
Y = 0
End Sub

Copy the code below for creating number series across the columns using inputbox function:

Sub SeriesInColumns()
Dim X, Y, A, B, N
Y = InputBox(“Enter the Row Offset”, “(Optional) Empty cells between series”, 0)
A = InputBox(“Enter the starting number in the series”, “Starting Number”, 1)
B = InputBox(“Enter the ending number in the series”, “Ending Number”, 50)
For N = A To B
ActiveCell.Value = N
ActiveCell.Offset(X, Y + 1).Select
Next N
X = 0
Y = 0
End Sub

Click the link below to download the macro file

Click here to download the file

I am very sure that this could be a best example for excel vba input box examples.

himaghiri

Founder at HBN Infotech
Himaghiri Thanayan.N is the founder of HBN Infotech. He has great dreams and passion for Graphic Design, Web Design, CAD Design, Arts & Crafts, Science & Information Technology and Article Writing.

Subscribe Us On YouTube

Like Our Page For Latest Tutorial Updates

Updated: November 19, 2017 — 7:49 am

Leave a Reply

Your email address will not be published. Required fields are marked *

one × 3 =

HBN Infotech © 2016 Frontier Theme