jimmybangs
New Member
- Joined
- Nov 28, 2008
- Messages
- 36
Hi There,
I have set up a really simple UserForm in VBA that populates a worksheet that is made up of 4 columns - I've included the code below:
<a href="http://www.flickr.com/photos/67298551@N07/6165759057/" title="Table by digiteers, on Flickr"><img src="http://farm7.static.flickr.com/6159/6165759057_7684de272f.jpg" width="402" height="182" alt="Table"></a>
I wondered if there was a way in which I could set up another UserForm that would have the same appearance as this with the following areas added:
I have set up a really simple UserForm in VBA that populates a worksheet that is made up of 4 columns - I've included the code below:
<a href="http://www.flickr.com/photos/67298551@N07/6165759057/" title="Table by digiteers, on Flickr"><img src="http://farm7.static.flickr.com/6159/6165759057_7684de272f.jpg" width="402" height="182" alt="Table"></a>
Code:
Private Sub UserForm_Initialize()
[INDENT]With DDSalutation[/INDENT]
[INDENT][INDENT].AddItem "Mr"[/INDENT][/INDENT]
[INDENT][INDENT].AddItem "Mrs"[/INDENT][/INDENT]
[INDENT][INDENT].AddItem "Miss"[/INDENT][/INDENT]
[INDENT][INDENT].AddItem "Ms"[/INDENT][/INDENT]
[INDENT]End With[/INDENT]
[INDENT]DDSalutation.Value = ""[/INDENT]
[INDENT]TxtFirstName.Value = ""[/INDENT]
[INDENT]TxtLastName.Value = ""[/INDENT]
[INDENT]TxtCompanyName.Value = ""[/INDENT]
[INDENT]TxtEmailAddress.Value = ""[/INDENT]
End Sub
Private Sub CommandCancel_Click()
[INDENT][/INDENT]Unload Me
End Sub
Private Sub CommandButtonSave_Click()
[INDENT]ActiveWorkbook.Sheets("Bookings").Activate[/INDENT]
[INDENT]Range("A1").Select[/INDENT]
[INDENT]Do[/INDENT]
[INDENT]If IsEmpty(ActiveCell) = False Then[/INDENT]
[INDENT][INDENT]ActiveCell.Offset(1, 0).Select[/INDENT][/INDENT]
[INDENT]End If[/INDENT]
[INDENT]Loop Until IsEmpty(ActiveCell) = True[/INDENT]
[INDENT]ActiveCell.Value = DSBookingDate.Value[/INDENT]
[INDENT]ActiveCell.Offset(0, 1) = DDSalutation[/INDENT]
[INDENT]ActiveCell.Offset(0, 2) = TxtFirstName[/INDENT]
[INDENT]ActiveCell.Offset(0, 3) = TxtLastName[/INDENT]
[INDENT]ActiveCell.Offset(0, 4) = TxtCompanyName[/INDENT]
[INDENT]ActiveCell.Offset(0, 5) = TxtEmailAddress[/INDENT]
[INDENT]Range("A1").Select[/INDENT]
End Sub
I wondered if there was a way in which I could set up another UserForm that would have the same appearance as this with the following areas added:
- Ability to search by various fields
- Ability to edit search returns within the form using a Next/Button to find the appropriate entry to amend