We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

in excell I want to put in a button to insert a row

TIMFOX123
TIMFOX123 asked
on
Medium Priority
248 Views
Last Modified: 2012-05-11
I  want to put in a button that just inserts a new row above row 2

Comment
Watch Question

Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Thanks sah18, missed that. Basically right-click the button and assign macro.
Rob HensonFinance Analyst
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Saqib HusainEngineer
CERTIFIED EXPERT

Commented:
While there are suggestions here is my innovative one. Although it appears a bit clumsy but I think it is just right for your scenario.

Insert this macro in the workbook module for the worksheet and change the second line to accommodate the name of your worksheet. Save the file, close it and open it.

This will create a triangle at the left edge of the worksheet which is not printable. Clicking on this triangle will insert a row at row 2.

Saqib


Private Sub Workbook_Open()
Set sh = Sheets("sheet1")
For Each shp In sh.Shapes
If Right(shp.OnAction, 23) = "ThisWorkbook.inslineat2" Then shp.Delete
Next shp
Set a = sh.Shapes.AddShape(msoShapeIsoscelesTriangle, 0, 0, 5, [a1].Height)
a.OnAction = "ThisWorkbook.inslineat2"
a.Rotation = 180
a.OLEFormat.Object.PrintObject = False
a.Fill.ForeColor.SchemeColor = 8
a.Fill.Visible = msoTrue
a.Line.Visible = msoFalse
End Sub
Sub inslineat2()
[2:2].Insert
End Sub

Open in new window

Author

Commented:
Great job

Actually I pretty much knew how to do this in the old excel,   the new excel is so different

thx
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.