K
K1KKKA
Hi All
HYCH
Am looking for some assistance with the following,
i use a form to enter details about individuals, this enters the info
into a column at the end of the line and then sorts into alphabetical
order. no problem with this,
But,
I would like to use a form to select an individual from anywhere in
the range and delte their details,
every name is range from D3:EU3 (Combo box initialises this ok)
And the data is listed under each person down a column, is there
someway to adjust the code below to allow this to work??
This section works fine!!!
Private Sub UserForm_Initialize()
Dim cLoc As Range
Dim ws As Worksheet
Set ws = Worksheets("rotaref")
For Each cLoc In ws.Range("D3:ET3")
With Me.ComboBox1
.AddItem cLoc.Value
.List(.ListCount - 1, 1) = cLoc.Offset(0, 1).Value
End With
Next cLoc
Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
Me.TextBox3.Value = ""
Me.ComboBox1.Value = ""
Me.ComboBox1.SetFocus
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
This section needs help????
Private Sub CmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("RotaRef")
ws.Cells(200, iRow).Value = Me.TextBox1.Value
ws.Cells(201, iRow).Value = Me.TextBox2.Value
ws.Cells(3, iRow).Value = Me.TextBox3.Value
Me.ComboBox1.Value = ""
Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
Me.TextBox3.Value = ""
Me.ComboBox1.SetFocus
End Sub
This section may need help???
Private Sub ComboBox1_Change()
Dim iRow As Long
With Me
iRow = .ComboBox1.ListIndex + 5
.TextBox1.Text = Worksheets("ROTAREF").Cells(iRow, 200).Value
.TextBox2.Text = Worksheets("ROTAREF").Cells(iRow, 201).Value
.TextBox3.Text = Worksheets("ROTAREF").Cells(iRow, 3).Value
End With
End Sub
Please help with this, driving me mad LOL
HYCH
Steve
HYCH
Am looking for some assistance with the following,
i use a form to enter details about individuals, this enters the info
into a column at the end of the line and then sorts into alphabetical
order. no problem with this,
But,
I would like to use a form to select an individual from anywhere in
the range and delte their details,
every name is range from D3:EU3 (Combo box initialises this ok)
And the data is listed under each person down a column, is there
someway to adjust the code below to allow this to work??
This section works fine!!!
Private Sub UserForm_Initialize()
Dim cLoc As Range
Dim ws As Worksheet
Set ws = Worksheets("rotaref")
For Each cLoc In ws.Range("D3:ET3")
With Me.ComboBox1
.AddItem cLoc.Value
.List(.ListCount - 1, 1) = cLoc.Offset(0, 1).Value
End With
Next cLoc
Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
Me.TextBox3.Value = ""
Me.ComboBox1.Value = ""
Me.ComboBox1.SetFocus
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
This section needs help????
Private Sub CmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("RotaRef")
ws.Cells(200, iRow).Value = Me.TextBox1.Value
ws.Cells(201, iRow).Value = Me.TextBox2.Value
ws.Cells(3, iRow).Value = Me.TextBox3.Value
Me.ComboBox1.Value = ""
Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
Me.TextBox3.Value = ""
Me.ComboBox1.SetFocus
End Sub
This section may need help???
Private Sub ComboBox1_Change()
Dim iRow As Long
With Me
iRow = .ComboBox1.ListIndex + 5
.TextBox1.Text = Worksheets("ROTAREF").Cells(iRow, 200).Value
.TextBox2.Text = Worksheets("ROTAREF").Cells(iRow, 201).Value
.TextBox3.Text = Worksheets("ROTAREF").Cells(iRow, 3).Value
End With
End Sub
Please help with this, driving me mad LOL
HYCH
Steve