Adding multiple rows of data to a worksheet via a UserForm, BUT starting on the 3rd row

vgwhitle

New Member
Joined
Sep 16, 2014
Messages
21
I feel as though this is a simple fix, but for some reason it is stumping me. I created a UserForm in VBA. I want the user to continually type data into the UserForm and hit the "Add" button after every entry and it automatically display on the worksheet row after row with no blank rows in-between. My merged column headings take up rows 1 and 2, so the entered information from the UserForm must start on row 3, then go on row 4, then row 5, and so on. From the code below my entered information skips a row so that the first line doesn't get placed in the merged column heading rows (rows 1 and 2). Is there an easy solution here? Thanks for any help in advance.
'V

Private Sub AddBtn_Click()

Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Room Schedules")

nr = ws.Cells(Rows.Count, 1).End(xlUp).Row + 2 <--(I know I can't do Row + 1 because this is when the entered data goes in the column headings)

ws.Cells(nr, 1) = CourseTBox.Value
ws.Cells(nr, 2) = RoomLBox.Value
ws.Cells(nr, 3) = StartTimeTBox.Value
ws.Cells(nr, 4) = EndTimeTBox.Value

Call ClearFormBtn_Click

End Sub
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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