Help needed, data input

Johncanty85

New Member
Joined
Dec 9, 2018
Messages
1
Hi all, was hoping someone could offer some advice/help. Trying to devise a way of logging payments using a simple userform. I was hoping to have individual sheets for individual jobs with a dropdown on the userform correlating to each sheet - hope is that user would have to select job title/sheet name from a drop down menu, input a brief description and a total and that would then pre populate the next available cell in the relevant column.. Not sure if what I'm describing is possible but I would really appreciate any pointers any one could offer as not very well versed in vda.. Thanks in advance
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Well you did not say what this means:
You said:
pre populate the next available cell in the relevant column

What is the relevant column?

This script here will load all the sheet names into Combobox1 which is on your Userform.

Then you enter data into Textbox1 and Textbox2

Then press Command button1
The script will enter the data that's in Textbox1 and Textbox2 in columns A and B of the sheet you selected from the Combobox

If this is not what you want we need more specific details.

Put this script in your Userform.

Code:
Private Sub CommandButton1_Click()
'Modified  12/9/2018  5:59:57 PM  EST
Dim Lastrow As Long
Dim ans As String
ans = ComboBox1.Value
Lastrow = Sheets(ans).Cells(Rows.Count, "A").End(xlUp).Row + 1
Sheets(ans).Cells(Lastrow, 1).Value = TextBox1.Value
Sheets(ans).Cells(Lastrow, 2).Value = TextBox2.Value
End Sub
Private Sub UserForm_Initialize()
'Modified  12/9/2018  5:59:57 PM  EST
Dim i As Long
    For i = 1 To Sheets.Count
        ComboBox1.AddItem Sheets(i).Name
    Next
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,247
Messages
6,171,007
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top