Hi,
I am currently designing userform which allows user to add sickness or holidays in the sheet.These are copied one below the other and are working fine.
Absences once inputted need not be edited, however holidays may need to be changed. I have designed userform which basically combines Employee name and date as range and gives me data which has been entered in the sheet.
This range is added to the row source property of combobox on the userform=OFFSET('DATABASE-H'!$B$1,1,0,COUNTA('DATABASE-H'!$B$2:$B$1500),1) (REFERS TO THE RANGE)
There are 7 Textboxes which refere to corresponding holiday details for that Employee
This code basically populates text boxes with the corresponding values referring to the value selected from combobox1Private Sub ComboBox1_Click() Dim i% ActiveCell.Select '[a1].Select Dim LB As New Collection LB.Add UserForm1.TextBox1 LB.Add UserForm1.TextBox2 LB.Add UserForm1.TextBox3 LB.Add UserForm1.TextBox4 LB.Add UserForm1.TextBox5 LB.Add UserForm1.TextBox6 LB.Add UserForm1.TextBox7 For i = 1 To 7 LB(i) = Worksheets("DATABASE-H").Cells(ComboBox1.ListIndex + 1, i) Next i End Sub
Now comes the problem part
The above sub should be just inputting modified values in the sheet again at the corresponding positions but it dosentPrivate Sub CommandButton1_Click() ActiveCell.Offset(0, 0).Value = TextBox1.Value ActiveCell.Offset(0, 1).Value = TextBox2.Value ActiveCell.Offset(0, 2).Value = TextBox3.Value ActiveCell.Offset(0, 3).Value = TextBox4.Value ActiveCell.Offset(0, 4).Value = TextBox5.Value ActiveCell.Offset(0, 5).Value = TextBox6.Value ActiveCell.Offset(0, 6).Value = TextBox7.Value Unload Me End Sub
I think its not activating cell corresponding to the value selected (on combobox)
Can someone please HELP!!
Hope this all makes sense.
Please do let me know if you need any further information
Any help would be much appreciated
Thanks in advance
Last edited by Leith Ross; 06-10-2009 at 01:06 PM. Reason: Added Code Tags
Hello visitophir,
To make your posts easier to read, copy, and edit please wrap your code. I did it for you this time. Here is how you can do it next time.
How to wrap your Code
1. Select all your code using the mouse.
2. Click on the # icon on the toolbar in the Message window. This will automatically wrap the text you selected with the proper Code tags to create a Code Window in your post.
3. You can also do this manually by placing the tag [code] at the start of the line, and the tag [/code] at the end.
As a member, You have agreed to follow the forum posting rules. Please take so time to familiarize yourself with the Do's and Don'ts here in the Forum, just click on the link below...
Forum Rules
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Starbelow the post.
3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks