Userform to export data to another sheet [Solved/Closed]

Posts
11
Registration date
Monday March 21, 2016
Last seen
March 24, 2016
- - Latest reply: redbaby
Posts
11
Registration date
Monday March 21, 2016
Last seen
March 24, 2016
- Mar 24, 2016 at 08:53 AM
Hello everybody,

Please could anyone spare his/her scares time to help me, I'm new in this forum and I hope to be an expert in excel. Your contributions would be highly appreciated, thank you.

I have a userform named MembersInformationEntry; it as the following details:

Label1 named 'member Name' with a corresponding textbox4 (MembersData B2)

Label2 named 'Monthly Savings' with a corresponding textbox1 (MembersData E2)

Label3 named 'Application fee' with a corresponding textbox2 (MembersData G2)

Label4 named 'Date Joined' with a corresponding textbox3 (MembersData C2)

Option Botton1 for 'Cleared' and Option Botton2 for 'Not Cleared' (MembersData H2)

Command Botton1 for 'OK'(this is to transfer new member info to a sheet named "membersdata" in the next available emty row as indicated above) and Command Botton2
See more 

3 replies

Posts
2453
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
March 25, 2019
412
0
Thank you
Hi Redbaby,

Since you are eager to learn, check out this link:
http://www.excel-easy.com/vba/userform.html

The thing you might miss is to put data in the first available row:
Range("A"&rows.count).end(xlup).offset(1,0)

Good luck, have fun and best regards,
Trowa
redbaby
Posts
11
Registration date
Monday March 21, 2016
Last seen
March 24, 2016
-
Thanks a lot, I enjoy having you in this forum.
Posts
11
Registration date
Monday March 21, 2016
Last seen
March 24, 2016
0
Thank you
Thanks for the hint,

Please I have manage to write the code hereuder from the example you gave me but when I ran it, it is showing Run-time error '424' Object required. Where do I go from here, I'm lost.

Secondly, I like the to have a command button on a sheet named 'Home' that if I click the form will show and then fill data and then transfer to sheet named 'MembersData'

Private Sub ClearCommandButton_Click()

Call UserForm_Initialize

End Sub

Private Sub OkCommandButton_Click()

Dim emptyRow As Long

'Make Sheet1 active
Sheet1.Activate

'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("B:B")) + 1

'Transfer information
Cells(emptyRow, 2).Value = NameTextBox.Value
Cells(emptyRow, 3).Value = DateTextBox.Value
Cells(emptyRow, 5).Value = SivingsTextBox.Value
Cells(emptyRow, 7).Value = AppFeeTextBox.Value
Cells(emptyRow, 8).Value = ClearedCheckBox1.Value
Cells(emptyRow, 8).Value = NotClearedCheckBox.Value

End Sub

Private Sub UserForm_Initialize()

'Empty NameTextBox
NameTextBox.Value = ""
SavingsTextBob.Value = ""
AppFeeTextBox.Value = ""
DateTextBox.Value = ""

'Uncheck DataCheckBoxes
ClearedCheckBox1.Value = False
NotClearedCheckBox.Value = False

End Sub
Posts
11
Registration date
Monday March 21, 2016
Last seen
March 24, 2016
0
Thank you
Hello Everybody,

Let me start by appreciating all members of this forum for your support especially TrowaD.

I have been manage to put this codes together and it working well, I had to replace the check box with the combo box.

Option Explicit


Private Sub CancelCommandButton_Click()
Unload Me
End Sub

Private Sub ClearCommandButton_Click()

Call UserForm_Initialize

End Sub

Private Sub OkCommandButton_Click()

Dim emptyRow As Long

'Make Sheets active
Sheets("MembersData").Activate

'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("B:B")) + 1

'Transfer information
Cells(emptyRow, 2).Value = NameTextBox.Value
Cells(emptyRow, 3).Value = DateTextBox.Value
Cells(emptyRow, 5).Value = SavingsTextBox.Value
Cells(emptyRow, 7).Value = AppFeeTextBox.Value
Cells(emptyRow, 8).Value = StatusComboBox.Value

End Sub

Private Sub UserForm_Initialize()

'Empty NameTextBox
NameTextBox.Value = ""
SavingsTextBox.Value = ""
AppFeeTextBox.Value = ""
DateTextBox.Value = ""

'Empty StatusComboBox
StatusComboBox.Clear

'Fill StatusComboBox
With StatusComboBox
.AddItem "Cleared"
.AddItem "Not Cleared"
.AddItem "Pending"
End With

End Sub