List alpha numeric numbers between two references

sedwardson

New Member
Joined
Mar 2, 2023
Messages
35
Office Version
  1. 365
Platform
  1. Windows
I found this by Snakehips and it was VERY helpful ! I tried to modify it but found that it only works with numeric entries and not alpha numeric entries.

Rich (BB code):
VBA Code:
Sub Fill()    [A4] = [A1].Value
    ato = [B1].Value
    [B4] = [A2].Value
    bto = [B2].Value
    [C4] = [A3].Value
    cto = [B3].Value
    [A4].DataSeries Rowcol:=xlColumns, Type:=xlLinear, Step:=1, Stop:=ato
    [B4].DataSeries Rowcol:=xlColumns, Type:=xlLinear, Step:=1, Stop:=bto
[C4].DataSeries Rowcol:=xlColumns, Type:=xlLinear, Step:=1, Stop:=cto
End Sub

The code I wrote (but failed to get to work) was:

VBA Code:
Sub Fill()    
    [B3] = [B4].Value
    bto = [C3].Value
    [B4].DataSeries Rowcol:=xlColumns, Type:=xlLinear, Step:=1, Stop:=bto
End Sub


This works with numbers but not for the range I have which is: 531PZ228173 - 531PZ228222

Can anyone help with how I might get the range to work with this cell entry. Thanks.
P.S. Sorry if I've missed some detail out or you require more from me. This is my first post ! Please bear with me :-)
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Something like this?
VBA Code:
Sub test()
  Range("B4").AutoFill Destination:=Range("B4:B" & Range("C3").Value), Type:=xlFillSeries
End Sub
Where do you want to start copying? Where do you want to stop?
 
Upvote 0
Something like this?
VBA Code:
Sub test()
  Range("B4").AutoFill Destination:=Range("B4:B" & Range("C3").Value), Type:=xlFillSeries
End Sub
Where do you want to start copying? Where do you want to stop?
Hi Flashbond, I just need it to start at the first number 531PZ228173 and end at the last number 531PZ228222 (if you see, the last 3 digits increase and its those I want to list out sequentially) Thanks.
 
Upvote 0
No, I mean from which cell to which cell address? Where will it start and where will it stop?
 
Upvote 0
Hi Flashbond, I just need it to start at the first number 531PZ228173 and end at the last number 531PZ228222 (if you see, the last 3 digits increase and its those I want to list out sequentially) Thanks.
Apologies, if you meant which cells did I want to populate into with the output, it will be in B4 : B54
 
Upvote 0
Assuming 531PZ228173 is in B4
VBA Code:
Sub test()
  Range("B4").AutoFill Destination:=Range("B4:B54"), Type:=xlFillSeries
End Sub
 
Upvote 0
Hmm.... I get the following:
1677762045596.png

Thanks for your help btw :-)
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,171
Members
452,615
Latest member
bogeys2birdies

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