Skip to content

Instantly share code, notes, and snippets.

@aptavout
Created May 24, 2013 03:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aptavout/5641120 to your computer and use it in GitHub Desktop.
Save aptavout/5641120 to your computer and use it in GitHub Desktop.
Treat an Excel workbook as a 2-dimensional array, and iterate over it.
Range("A1").Select
Range(ActiveCell, ActiveCell.CurrentRegion).Select
For Each row In Selection.Rows
Dim rowStr As String
For Each col In Selection.Columns
rowStr = rowStr & Cells(row.Row, col.Column)
If col.Column < Selection.Columns.Count Then
rowStr = rowStr & ","
End If
Next
Next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment