Range listdown using WPS Office

Mr Kamal

New Member
Joined
Aug 16, 2021
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi

please help me

i have the range in excel sheet one column as below:

34501-34504
38210-38212

I want to listdown it in excel sheet in one column as below:

34501
34502
34503
34504
38210
38211
38212

regards,
Mr. Kamal
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
@Mr Kamal Paste this vba code to the vba editor and give it a try.

VBA Code:
Sub Re_List()

Dim Acell As Range
Dim SpltA() As String
Dim r As Long, c As Long
Application.ScreenUpdating = True

' ***assuming no headers so data starts row 1 edit to suit
r = 1  '**
'Re-List A data in column B
For Each Acell In Range("A1:A" & Range("A" & Rows.Count).End(xlUp).row)  '***

    SpltA = Split(Acell, "-")
    For c = 0 To (SpltA(1) - SpltA(0))
        Range("B" & r) = SpltA(0) + c
        r = r + 1
    Next

Next
Application.ScreenUpdating = True
End Sub

Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,223,993
Messages
6,175,838
Members
452,675
Latest member
duongtruc1610

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