How to list down the values in a name range using vba?

 Question:Suppose I have a name range Month and it has value from (jan,...., dec) . I want to list them using VBA.

 Answers
:
If you have listed them as Month like below,
enter image description here
Use the below code to loop through the named range Month and print the output in Column B,
Sub namedRange()
Dim RangeArray() As Variant, i As Integer
RangeArray = Range("Month")
For i = 1 To 12
    Cells(i, 2) = RangeArray(i, 1)
Next i
End Sub

Commentaires

Posts les plus consultés de ce blog

XAJAX with PHP – The future of web development

XAJAX with PHP – The future of web development

Database connection pooling in ADO.Net