VBA: Adding Data too 2 columns in A Dynamic Range using a User Form

bamaisgreat

Well-known Member
Joined
Jan 23, 2012
Messages
831
Office Version
  1. 365
Platform
  1. Windows
Thanks for looking !
I have bits and pieces of code below to attempt this.The code is incomplete.
My Goal is:
When Data is entered into textbox1 and textbox2 that information will go to the last empty row in columns H and I (which is Dynamic Range "Operators") when clicking on command button 1 in the userform.

embed

Code:
Private Sub CommandButton1_Click()
Dim adr As String
Range("Operators").Cells(1, 1).Offset(rws, 0).Value = UserForm5.TextBox1.Value
Range("Operators").Cells(1, 2).Offset(rws, 0).Value = UserForm5.TextBox2.Value
    
With Range("Operators").name
    adr = .RefersTo
    .Delete
End With
Range(adr).Resize(rws + 1, 1).name = "Operators"
Unload Me
End Sub
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,223,908
Messages
6,175,305
Members
452,633
Latest member
DougMo

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