Good Evening All,
I'm trying to select a range of cells based on what a user enters into an input box. In theory the selection I want to copy will always start in row ten so the user would just have to enter the column (it would be beneficial to know if a person can enter a specific cell ex B11 and the range will be selected based on that). I've tried using a string data type and entering the letter as well as using a long data type and entering the number of the column ie B would be 2. Both methods end with an application or object defined error...
Any thoughts would be greatly appreciated.
Thanks All
I'm trying to select a range of cells based on what a user enters into an input box. In theory the selection I want to copy will always start in row ten so the user would just have to enter the column (it would be beneficial to know if a person can enter a specific cell ex B11 and the range will be selected based on that). I've tried using a string data type and entering the letter as well as using a long data type and entering the number of the column ie B would be 2. Both methods end with an application or object defined error...
Code:
[FONT=Verdana]Sub TagType_Click()[/FONT]
[FONT=Verdana]
Dim MyCell As Long[/FONT]
[FONT=Verdana]
MyCell = InputBox("What Column Are The Document Numbers Located In?")[/FONT]
[FONT=Verdana]
Dim wb1 As Workbook, shxx As Worksheet
Set wb1 = ActiveWorkbook[/FONT]
[FONT=Verdana]
Set shxx = wb1.Sheets(2)[/FONT]
[FONT=Verdana] Dim Cl As Range[/FONT]
[FONT=Verdana]
With CreateObject("scripting.dictionary")
For Each Cl In shxx.Range("MyCell", shxx.Range("MyCell").End(xlDown))
.Item(Cl.Value) = Cl.Offset(, 1).Value
Next Cl
For Each Cl In shxx.Range("C1", shxx.Range("C1").End(xlDown))
Cl.Offset(, 1).Value = .Item(Cl.Value)
Next Cl
End With[/FONT]
[FONT=Verdana]End Sub[/FONT]
Any thoughts would be greatly appreciated.
Thanks All