Dedcrayzie
Technical User
Hi Fellow KnuckleRiders,
I'm wondering if y'all can help me out on this one. I'm fairly new to VBA myself but with a few inputs was able to come up with the code below. What I didn't do however was clear the value out of the userform after it had been entered. Any pointers please?
************************************************************
Private Sub CommandButton1_Click()
Worksheets(2).Cells(entryCount + 7, 8).Value = TextBox1.Value
UserForm1.Hide
End Sub
Private Sub UserForm_Activate()
Dim B As Integer
Dim strMsg As String
Dim strDate As String
entryCount = 0
strMsg = "For the current period, "
For B = 7 To 20
If Not Worksheets(2).Cells(B, 8).Value = "" Then
entryCount = entryCount + 1
End If
Next
strDate = Worksheets(2).Cells(entryCount + 7, 4).Value
strMsg = strMsg & entryCount & " of 14 dates" & vbCrLf & _
"already have exchange rates entered." & vbCrLf & vbCrLf & _
"Enter exchange rate for " & strDate & " below."
Label1.Caption = strMsg
End Sub
************************************************************
Cheers Fellas,
![[afro] [afro] [afro]](/data/assets/smilies/afro.gif)
I'm wondering if y'all can help me out on this one. I'm fairly new to VBA myself but with a few inputs was able to come up with the code below. What I didn't do however was clear the value out of the userform after it had been entered. Any pointers please?
************************************************************
Private Sub CommandButton1_Click()
Worksheets(2).Cells(entryCount + 7, 8).Value = TextBox1.Value
UserForm1.Hide
End Sub
Private Sub UserForm_Activate()
Dim B As Integer
Dim strMsg As String
Dim strDate As String
entryCount = 0
strMsg = "For the current period, "
For B = 7 To 20
If Not Worksheets(2).Cells(B, 8).Value = "" Then
entryCount = entryCount + 1
End If
Next
strDate = Worksheets(2).Cells(entryCount + 7, 4).Value
strMsg = strMsg & entryCount & " of 14 dates" & vbCrLf & _
"already have exchange rates entered." & vbCrLf & vbCrLf & _
"Enter exchange rate for " & strDate & " below."
Label1.Caption = strMsg
End Sub
************************************************************
Cheers Fellas,
![[afro] [afro] [afro]](/data/assets/smilies/afro.gif)