Sorry I had no idea how to Title this post.
Im working with this wonderfull peice of VBA code that pulls (copys) all of the 9 digit values in a range and puts them into a column on the same worksheet.
Currently this runs in order of left to right, top to bottom. ie.. A1,A2,A3,B1,B2,B3
Is there any way to have it look top to bottom, then left to right? ie.. A1,B1,C1,A2,B2,C2.
Thanks for the help!
Im working with this wonderfull peice of VBA code that pulls (copys) all of the 9 digit values in a range and puts them into a column on the same worksheet.
Currently this runs in order of left to right, top to bottom. ie.. A1,A2,A3,B1,B2,B3
Is there any way to have it look top to bottom, then left to right? ie.. A1,B1,C1,A2,B2,C2.
Code:
Sub Solid()
Dim objReg As Object, objMatch As Object, objColl As Object
Dim rngWhole As Excel.Range
Dim rngCell As Excel.Range
Dim lngRow As Long: lngRow = 1
Set objReg = CreateObject("vbscript.regexp")
Set rngWhole = Sheets("Solid").Range("Solid")
With objReg
.Global = True
.Pattern = "\d{9}"
For Each rngCell In rngWhole
Set objColl = .Execute(rngCell.Value)
For Each objMatch In objColl
Sheets("Solid").Range("cc" & lngRow).Value = objMatch.Value
lngRow = lngRow + 1
Next objMatch
Next rngCell
End With
Set objReg = Nothing
Set objMatch = Nothing
Set objColl = Nothing
Set rngWhole = Nothing
End Sub
Thanks for the help!