Fill serie

  • Thread starter Thread starter Basta1980
  • Start date Start date
B

Basta1980

Hi,

I would like to know if it is possible to fill a column based upon input
from a textbox. What I'm trying to do is; ask user to manually input first 8,
9 or 10 digits (fixed line number). Then the user has to choose (with the
help of three buttons) if he/she wants to automatically fill a serie by 10,
100 or 1000. So if a user fills in 31101234 and then click button 'add 1000'
(fictive name), excel fills the serie in column A, Row1 like this;
31101234000 down to 31101234999. And if this is possible, how do I go about?!

Regards

Basta1980
 
Have you tried this option

--Type 31101234000 in Cell A1
--From menu>Edit>Fill>series
--Select 'Series In' as Columns
--Keep the step value as 1
--In Stop Value enter 31101234999
--Hit 'OK'

If this post helps click Yes
 
Jacob,

Am familair with that, but my co-workers who need to work with the same
workbook are not so Excel savvy. As I'm no VBA savvy I hoped that at least by
creating some code that helps them through the different options would make
my life easier and theres too.

Regards,

Basta
 
OK. You can try out the below macro. If you are new to macros..

--Set the Security level to low/medium in (Tools|Macro|Security).
--From workbook launch VBE using short-key Alt+F11.
--From menu 'Insert' a module and paste the below code.
--Get back to Workbook.
--Run macro from Tools|Macro|Run <selected macro()>


Sub Macro()
varStart = InputBox("Enter Start Num")
varSeries = InputBox("Numbers to be filled" & _
String(3, vbLf) & "10,100,1000 etc;", , 100)
Range("A1") = varStart * varSeries
Range("A1").DataSeries Rowcol:=xlColumns, _
Type:=xlLinear, Step:=1, Stop:=Range("A1") + varSeries - 1
End Sub

If this post helps click Yes
 
Back
Top