cjyogz
08-08-2006, 02:31 AM
Hello reader,
I have a sequence of code (below). When the user double clicks on a certain cell in Sheet("Income"), it initializes a UserForm(this code is not displayed below.) When the UserForm Initializes, it selects Sheet("Data") to collect information from cells contained in Rows A,B & C.
What i need help with, is i some how need to Store the Sheet("Income") as a Value of some sort so that after the code below has finished, it SetsFocus on Sheet("Income"). I also need it to SetFocus on the specific cell that the user double clicked. For example, A3, A4, A5, A6 and so on.
I would appreciate all the help i can get, even if you have a different way around my problem, then i am willing to try it.
Yours Great fully
Chris J
Private Sub UserForm_Initialize()
Sheets("Data").Select
Range("B2").Select
Do Until Selection.Value = False
cboExpense.AddItem (Selection.Value)
ActiveCell.Offset(1, 0).Select
Loop
Range("C2").Select
Do Until Selection.Value = False
cboIncome.AddItem (Selection.Value)
ActiveCell.Offset(1, 0).Select
Loop
Range("A2").Select
Do Until Selection.Value = False
cboSponsor.AddItem (Selection.Value)
ActiveCell.Offset(1, 0).Select
Loop
I have a sequence of code (below). When the user double clicks on a certain cell in Sheet("Income"), it initializes a UserForm(this code is not displayed below.) When the UserForm Initializes, it selects Sheet("Data") to collect information from cells contained in Rows A,B & C.
What i need help with, is i some how need to Store the Sheet("Income") as a Value of some sort so that after the code below has finished, it SetsFocus on Sheet("Income"). I also need it to SetFocus on the specific cell that the user double clicked. For example, A3, A4, A5, A6 and so on.
I would appreciate all the help i can get, even if you have a different way around my problem, then i am willing to try it.
Yours Great fully
Chris J
Private Sub UserForm_Initialize()
Sheets("Data").Select
Range("B2").Select
Do Until Selection.Value = False
cboExpense.AddItem (Selection.Value)
ActiveCell.Offset(1, 0).Select
Loop
Range("C2").Select
Do Until Selection.Value = False
cboIncome.AddItem (Selection.Value)
ActiveCell.Offset(1, 0).Select
Loop
Range("A2").Select
Do Until Selection.Value = False
cboSponsor.AddItem (Selection.Value)
ActiveCell.Offset(1, 0).Select
Loop