Trying to add New names to a user list table with a user form. In the current format it does not show up on the table, what do I need to do?

alleneure

New Member
Joined
Feb 22, 2023
Messages
17
Office Version
  1. 365
Platform
  1. Windows
I have a summary area pulling from other sheets on that are below the table I would like to add names to. The table name is "UserTable" and I want to add first name to 2nd column and want to add last name to the 3rd column. For the time being I have moved it to below the summary and it works fine but would like the final resting place of the summary to be where I have it in the screenshot.
VBA Code:
Private Sub AddUserButton_Click()

Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Summary")

'find first empty row in database
iRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _
    SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1


'copy the data to the database
'use protect and unprotect lines,
'     with your password
'     if worksheet is protected
With ws
'  .Unprotect Password:="password"
  .Cells(iRow, 26).Value = Me.txtFirstName.Value
  .Cells(iRow, 27).Value = Me.txtLastName.Value
'  .Protect Password:="password"
End With

'clear the data
Me.txtFirstName.Value = ""
Me.txtLastName.Value = ""
'Focus on First name for another entry
Me.txtFirstName.SetFocus


End Sub

1682000367422.png
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Nevermind, I figured it out. If anyone wants/need to know refer to this thread.
 
Upvote 0

Forum statistics

Threads
1,215,680
Messages
6,126,188
Members
449,296
Latest member
tinneytwin

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