VBA Function to Bring back the Frequency Values in On Cell

Stephen_IV

Well-known Member
Joined
Mar 17, 2003
Messages
1,180
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Is it possible to bring back the frequency values in to one cell? Any help would be appreciated! Thanks again Stephen.



Book1
ABCDEF
137Frequency Values
2570-64437, 57, 62, 64
36265-71171
46473-82775,77,78,78,78,79,82
57183-90887,88,88,88,88,89,89,89
67591-100592,93,94,100,100
777
878
978
1078
1179
1282
1387
1488
1588
1688
1788
1889
1989
2089
2192
2293
2394
24100
25100
Sheet3
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Ok I am trying! Not a coder. Is it possible in the code to automatically parse the 0-64 in the code instead of ymin and ymax? This way I can automatically just pull down.

Currently looks like this!
Frequency Values
=items(0,64,$A$1:$A$25,", ")
=items(65,71,$A$1:$A$25,", ")
=items(73,82,$A$1:$A$25,", ")
=items(83,90,$A$1:$A$25,", ")
=items(91,100,$A$1:$A$25,", ")

Question 2 - How do I get that last comma out of there i.e. 37, 57, 62, 64,


Thanks in advance Stephen


Code:
Public Function items(ymin As Integer, ymax As Integer, r As Range, Optional seperator As String)
Dim i As Long
Dim j As Long
Dim ret As String
Dim rr As Range

For Each rr In r
    If rr.Value >= ymin And rr.Value<= ymax Then
    ret = ret & rr.Value & seperator
    End If
Next
items = ret
End Function


VBA Function to Bring back the Frequency Values in On Cell.xlsm
ABCDE
137Frequency Values
2570-64437, 57, 62, 64,
36265-71171,
46473-82775, 77, 78, 78, 78, 79, 82,
57183-90887, 88, 88, 88, 88, 89, 89, 89,
67591-100592, 93, 94, 100, 100,
777
878
978
1078
1179
1282
1387
1488
1588
1688
1788
1889
1989
2089
2192
2293
2394
24100
25100
Sheet1
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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