Hi all,
I have a excel doc with 2 userforms so that the workbook if filled out in 2 stages.
Firstly the when someone books a meeting, they select the "caller" button and input the details of the meeting (from A to I). Then when the person takes the meeting (who may not be the same person who booked it), they select the "post appointment" button and fill out what happened in the meeting (in cells J to M).
The problem is that the meetings will be entered before the earlier ones have occurred - so the second userform needs to input the details of that particular meeting next to the initial details that was entered earlier. Badly explained I know, but have a look at the doc attached and it will become clearer.
So my idea to overcome this problem would be to use a filter to select the "date held" of today, open the second userform, enter in the details and populate the cells next to the details of this meeting. HOWEVER the userform is populating the hidden cells ie the first available empty row (starting from J. How to I specify that I want the second userform to populate ONLY VISIBLE CELLS?
Here is the code for the second userform:
Private Sub Label1_Click()
End Sub
Private Sub CommandButton3_Click()
End Sub
Private Sub cmdClear_Click()
For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Or TypeName(ctl) = "ComboBox" Then
ctl.Value = ""
ElseIf TypeName(ctl) = "CheckBox" Then
ctl.Value = False
End If
Next ctl
End Sub
Private Sub cmdExit_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")
iRow = ws.Range("J:M").Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
RowCount = Worksheets("Sheet1").Range("J3").CurrentRegion.Rows.Count
With Worksheets("Sheet1").Range("J3")
ws.Cells(iRow, 10).Value = Me.txtPostContent.Value
ws.Cells(iRow, 11).Value = Me.txtFollowUp.Value
ws.Cells(iRow, 12).Value = DateValue(Me.txtdtDateFollow.Value)
ws.Cells(iRow, 13).Value = Me.cboTracker.Value
End With
If Not IsDate(Me.txtdtDateFollow.Value) Then
MsgBox "The Date booked box must contain a date.", vbExclamation, "Post Appointment Entry Form Error"
Me.txtdtDateFollow.SetFocus
Exit Sub
End If
If Me.cboTracker.Value = "" Then
MsgBox "Please enter the initials of the person whom you would like to track this follow up.", vbExclamation, "Post Appointment Entry Form Error"
Me.cboTracker.SetFocus
Exit Sub
End If
If Me.txtFollowUp.Value = "" Then
MsgBox "Please enter the follow up actions that are required.", vbExclamation, "Post Appointment Entry Form Error"
Me.txtFollowUp.SetFocus
Exit Sub
End If
If Me.txtPostContent.Value = "" Then
MsgBox "Please enter in the content of the appointment. This should contain what the appointment was about/its purpose, what was demoed and how the appointment was received.", vbExclamation, "Post Appointment Entry Form Error"
Me.txtPostContent.SetFocus
Exit Sub
End If
End Sub
I'd be really grateful for some help - I've been trying to solve this for ages and failing.
Thanks!
Bookmarks