Need Help with VBA code

tannerkn

New Member
Joined
Jul 15, 2014
Messages
10
Hello, I am trying to set up an order sheet and I am trying to figure out how to get a command button to do all the functions I want it to. So far I only have it inserting new line relative to the position of the command button.

Code:
Private Sub CommandButton2_Click()
CommandButton2.TopLeftCell.Rows.EntireRow.Insert
End Sub

I need 2 more parts to this code.

First, I need it to create a checkbox that says "RECEIVED" in column A of the new row that is inserted. the column width is 12.5, height is 20. I have gotten it to insert a checkbox, but not named and only in the same location. I haven't figured out how to make it relative to my command button.

Second, I need a formula that will autonumber sets of rows continously down the worksheet. ie. section 1; Hardware, line number: 1, 2, 3, 4, 5, 6, 7... skip a couple lines2; Lights, continued; 8, 9, 10, 11. But I need the code to update the lines lower down if a new row is inserted using the command button. (there is a command button 2 rows high between each section, along with 2 rows of titles and labels) is this possible?

Thanks,
Tanner
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I am still stuck with this. I tried to figure it out last night. But to no avail. Anyone able to help at all? even just part of it or point me in the right direction?
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

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