Sequence Function

MrDB4Excel

Active Member
Joined
Jan 29, 2004
Messages
348
Office Version
  1. 2013
Platform
  1. Windows
I am not sure this forum is the right place to ask about this.
I use Excel 2013 and have been looking for a downloadable add-in of the sequence function.
Is there such an add-in?
If so where can it be found?
 
Last edited:

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
I believe this UDF will duplicate that function:

Code:
Public Function Sequence(lngrows, Optional lngcolumns = 1, Optional start = 1, Optional Seqstep = 1) As Variant
Dim x, y, lngInc As Long, lngNumbers() As Long
ReDim lngNumbers(1 To lngrows, 1 To lngcolumns)
lngInc = start - 1
For x = 1 To lngrows
    For y = 1 To lngcolumns
        lngInc = lngInc + Seqstep
        lngNumbers(x, y) = lngInc
    Next
Next
Sequence = lngNumbers
End Functio
n
 
Upvote 0
I believe this UDF will duplicate that function:

Code:
Public Function Sequence(lngrows, Optional lngcolumns = 1, Optional start = 1, Optional Seqstep = 1) As Variant
Dim x, y, lngInc As Long, lngNumbers() As Long
ReDim lngNumbers(1 To lngrows, 1 To lngcolumns)
lngInc = start - 1
For x = 1 To lngrows
    For y = 1 To lngcolumns
        lngInc = lngInc + Seqstep
        lngNumbers(x, y) = lngInc
    Next
Next
Sequence = lngNumbers
End Functio
n

Not real sure how to get this to work.
On another note, once I saw a Youtube about the Xlookup function and discovered after a search that the Xlookup function is not available for Excel 2013's out of the box setup but is available as an add-in. This is why I asked in the first place if the sequence function might be available as an add-in.
Surely there must be such somewhere.
 
Upvote 0
Sorry the n was outside my Code block:

Code:
Public Function Sequence(lngrows, Optional lngcolumns = 1, Optional start = 1, Optional Seqstep = 1) As Variant
Dim x, y, lngInc As Long, lngNumbers() As Long
ReDim lngNumbers(1 To lngrows, 1 To lngcolumns)
lngInc = start - 1
For x = 1 To lngrows
    For y = 1 To lngcolumns
        lngInc = lngInc + Seqstep
        lngNumbers(x, y) = lngInc
    Next
Next
Sequence = lngNumbers
End Function

In a blank workbook, right click on the tab name and click on View Code.
This will take you to the Visual Basic Editor (VBE)
Copy the code and paste into white area.
Hit Alt-Q
Save workbook as type .xlam to save as an add-in
Then you can load this as an add-in.
 
Upvote 0
Sorry the n was outside my Code block:

Code:
Public Function Sequence(lngrows, Optional lngcolumns = 1, Optional start = 1, Optional Seqstep = 1) As Variant
Dim x, y, lngInc As Long, lngNumbers() As Long
ReDim lngNumbers(1 To lngrows, 1 To lngcolumns)
lngInc = start - 1
For x = 1 To lngrows
    For y = 1 To lngcolumns
        lngInc = lngInc + Seqstep
        lngNumbers(x, y) = lngInc
    Next
Next
Sequence = lngNumbers
End Function

In a blank workbook, right click on the tab name and click on View Code.
This will take you to the Visual Basic Editor (VBE)
Copy the code and paste into white area.
Hit Alt-Q
Save workbook as type .xlam to save as an add-in
Then you can load this as an add-in.

Having trouble getting this macro do what I need it to do. I caught on to this sequence function via this Youtube: https://www.youtube.com/watch?v=jPYVC29kNO8
When I get to the place in the video that shows this function: =sequence(7,7,B4,1) then it does not do what the video is showing.
 
Upvote 0
I didn't go through the whole video, but select your range.
Put the formula in the formula bar and hit CTRL-SHIFT-ENTER, this represents the sheet from the first part of the video.


Excel 2010
ABCDEFGHIJK
1Date7/5/2019SunMonTueWedThuFriSat
2First of Month7/1/2019-7-6-5-4-3-2-1
3Weekday20123456
4Offset-778910111213
514151617181920
621222324252627
728293031323334
835363738394041
Sheet1
Cell Formulas
RangeFormula
B2=EOMONTH(B1,-1)+1
B3=WEEKDAY(B2)
B4=-(B3+5)
E2:K8{=sequence(7,7,B4,1)}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Upvote 0
That's why I wrote my own version of it. See above for instructions. I ran this in Excel 2010 with the UDF above.
As well as instructions on how you can make it an add-in.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,574
Messages
6,173,144
Members
452,501
Latest member
musallam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top