billandrew
Well-known Member
- Joined
- Mar 9, 2014
- Messages
- 743
I have the below code which adds the desired sheets from Column A. My question is the understanding on the "Nothing".
My attempt to interpret is this is related to an item reference, in this case not necessary therefore the "Nothing"
Thank You for any explanation.....
My attempt to interpret is this is related to an item reference, in this case not necessary therefore the "Nothing"
Thank You for any explanation.....
Code:
[TABLE="width: 70"]
<colgroup><col width="70" style="width:53pt"> </colgroup><tbody>[TR]
[TD="width: 70"]Sub AddSheets()[/TD]
[/TR]
[TR]
[TD] Dim c As Range[/TD]
[/TR]
[TR]
[TD] With CreateObject("Scripting.dictionary")[/TD]
[/TR]
[TR]
[TD] For Each c In Range("A2", Range("A" & Rows.Count).End(xlUp))[/TD]
[/TR]
[TR]
[TD] If Not .exists(c.Value) Then Sheets.Add(, Sheets(1)).Name = c.Value[/TD]
[/TR]
[TR]
[TD] .Add c.Value, [COLOR=#ff0000]Nothing[/COLOR][/TD]
[/TR]
[TR]
[TD] Next c[/TD]
[/TR]
[TR]
[TD] End With[/TD]
[/TR]
[TR]
[TD] End Sub[/TD]
[/TR]
</tbody>[/TABLE]