Trebor8484
Board Regular
- Joined
- Oct 27, 2018
- Messages
- 69
- Office Version
- 2013
- Platform
- Windows
Hi, I am trying to output the contents of a dictionary to a worksheet.
I need to populate my dictionary into columns A and B into the last unused rows in both columns.
The dictionary will have an even number of items, so for example item 1,3,5,7,9 would go into column A and 2,4,6,8,10 into column B.
Any suggestions please?
I need to populate my dictionary into columns A and B into the last unused rows in both columns.
The dictionary will have an even number of items, so for example item 1,3,5,7,9 would go into column A and 2,4,6,8,10 into column B.
Any suggestions please?
VBA Code:
For Each rng In Sht.Range("D6:BM" & Sht.Cells(Rows.Count, "B").End(xlUp).Row).Columns
For Each c In rng.Cells
If c.Value = 0 Then
Cells(c.Row, c.Column).Interior.Color = 7303929
x = x + 1
dict.Add x, Cells(5, c.Column)
x = x + 1
dict.Add x, Cells(c.Row, 2)
End If
Next c
Next rng