Hi All,
So I made a little program and now am in the process of making it into an Add-In. After it was loaded as an Add-In it did not work quite right. It was how the worksheets were referenced. I fixed all the bugs but this one. So what should be happening, and works fine when I'm not using the code in an Add-In, Is this bit of code should be comparing one string to another. When used as an Add-In it does not work correctly and I believe it is because I don't properly state to do it on Worksheet 2 of the active Workbook. I've tried a couple different things but to no avail. Any thoughts would be greatly appreciated.
So I made a little program and now am in the process of making it into an Add-In. After it was loaded as an Add-In it did not work quite right. It was how the worksheets were referenced. I fixed all the bugs but this one. So what should be happening, and works fine when I'm not using the code in an Add-In, Is this bit of code should be comparing one string to another. When used as an Add-In it does not work correctly and I believe it is because I don't properly state to do it on Worksheet 2 of the active Workbook. I've tried a couple different things but to no avail. Any thoughts would be greatly appreciated.
Code:
[FONT=Verdana]Sub TagType_Click()
[/FONT]
[FONT=Verdana]Dim wb1 As Workbook, shxx As Worksheet[/FONT]
[FONT=Verdana]Set wb1 = ActiveWorkbook
Set shxx = wb1.Sheets(2)[/FONT]
[FONT=Verdana]
Dim Cl As Range[/FONT]
[FONT=Verdana]
shxx.Activate 'This will activate the sheet but does not solve the problem
ActiveSheet.Range("I1").Select
With ActiveSheet 'This does not appear to do anything
With CreateObject("scripting.dictionary")
For Each Cl In Range("I1", Range("I1").End(xlDown)) 'Tried changing how the cells will be referenced
.Item(Cl.Value) = Cl.Offset(, 1).Value 'Did not work out
Next Cl
For Each Cl In Range("C1", Range("C1").End(xlDown))
Cl.Offset(, 1).Value = .Item(Cl.Value)
Next Cl
End With
End With[/FONT]
[FONT=Verdana]
End Sub[/FONT]