A macro to bring up a data entry form to add data to the next empty row??

medwardnfriends

New Member
Joined
Jun 20, 2011
Messages
22
I need to write a macro that will be attached to a button, which when clicked will bring up a data entry form that will add info to the next open column after completion. Please help me with the writing of this code if you know how to do it. thanks
-Mark
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Try This.

Code:
Private Sub OK_Click()
        Application.ScreenUpdating = False

LRow = Range("A65536").End(xlUp).Row
        Cells(LRow, "A").Value = TextBox1.Value
        Cells(LRow, "B").Value = TextBox2.Value

Application.ScreenUpdating = True
Unload Me
End Sub
 
Upvote 0
In addition to the rpaulson's suggested code, a non-VBA alternative to consider is the use of Excel's built-in data form.

This isn't on the Ribbon so many people aren't aware it exists,
however it does exactly what you describe in your similar post on this topic...
http://www.mrexcel.com/forum/showthread.php?t=563757

In the xl2007 Help, Check out the topic titled:
Add, edit, find, and delete rows by using a data form
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,947
Latest member
Gerry_F

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