sharky12345
Well-known Member
- Joined
- Aug 5, 2010
- Messages
- 3,422
- Office Version
- 2016
- Platform
- Windows
I'm trying to add values from a row to an array and just can't figure it out.
What I can't work out is how to add the values from column H onward to an array. It's probably very straightforward but I've tried all manner of solutions and just can't get it to work. The latest thing I have tried is producing an array but it has extra blank values added too.
This is what I've been playing with, (don't make fun at how rough and crude it is, I'm doing my best to tinker and learn!).
What I can't work out is how to add the values from column H onward to an array. It's probably very straightforward but I've tried all manner of solutions and just can't get it to work. The latest thing I have tried is producing an array but it has extra blank values added too.
This is what I've been playing with, (don't make fun at how rough and crude it is, I'm doing my best to tinker and learn!).
VBA Code:
LastRow = ThisWorkbook.Worksheets("COPYRESULTS").Range("A65536").End(xlUp).Row
For Each Cell In ThisWorkbook.Worksheets("COPYRESULTS").Range("A2:A" & LastRow)
r = Cell.Row
ColNo = Cells(r, Columns.Count).End(xlToLeft).Column
ColLe = Col_Letter(Cells(r, Columns.Count).End(xlToLeft).Column)
Dim myary(1 To 7) As String
Dim var As Integer
Dim myrang As Range, myC As Range
var = 1
Set myrang = Range("H3:" & ColLe & "3")
For Each myC In myrang
myary(var) = "• " & myC.Value
var = var + 1
Next myC
For var = LBound(myary) To UBound(myary)
Debug.Print myary(var)
Next var
Next Cell
Any advice is appreciated!