Excel for Mac 2011 Macro Button to create new row and autofill

cda0608

New Member
Joined
Feb 15, 2016
Messages
5
Hi everyone,

I am new to VGA, but I really need to get this button to work.

I have a sheet with different tables. In my second table, I have 4 rows and 2 columns. The first column says 1st, 2nd, 3rd, 4th, and the second column is blank (besides having a thick border) for the user to fill in. Underneath the table I have placed a button, and have assigned a macro to that button.

I would like the button to make a new row above it and below the last row of my table, it must also autofill the first column with 5th,6th,etc. I can get the button to autofill 5th. Thereafter, if I pressed the button again, it adds a new row but keeps filling in 5th, because it does not have dynamic code to understand that it cannot keep referencing the 4th row.

Can anyone help?

Thanks!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Sub Macro9()
'
' Macro9 Macro
'


'
Rows("16:16").Select
Range("B16").Activate
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("B15:C15").Select
Selection.AutoFill Destination:=Range("B15:C16"), Type:=xlFillDefault
Range("B15:C16").Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,255
Members
448,556
Latest member
peterhess2002

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