title: How to properly define a child node for treeviews using VBA Excel?
body: <p>I am not sure why there is an invalid key error when I do convert it to a string just like how the examples do it.</p>
  
  <pre><code>Private Sub UserForm_Initialize()
  
  Dim i As Long, j As Long, Total_rows_Column As Long
  Dim unique_keys As Long
  
  For i = 1 To 5
      TreeView1.Nodes.Add Key:=Worksheets("Sheet1").Cells(1, i), Text:=Worksheets("Sheet1").Cells(1, i)
  Next i
  
  unique_keys = 0
  For i = 1 To 5
      Total_rows_Column = Worksheets("Sheet1").Range(Col_Letter(i) &amp; Rows.Count).End(xlUp).Row
      For j = 2 To Total_rows_Column
          unique_keys = unique_keys + 1
          'ERROR IN THE LINE BELOW************
          TreeView1.Nodes.Add Worksheets("Sheet1").Cells(1, i).Value, tvwChild, CStr(unique_keys), Worksheets("Sheet1").Cells(j, i).Value
      Next j
  Next i
  
  End Sub
  </code></pre>