Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2011-04-21
6
Medium Priority
?
221 Views
Last Modified: 2012-05-11
I  want to put in a button that just inserts a new row above row 2

0
Comment
Question by:TIMFOX123
6 Comments
 
LVL 24

Accepted Solution

by:
StephenJR earned 668 total points
ID: 35439768
Range("A2").EntireRow.Insert
0
 
LVL 9

Assisted Solution

by:sah18
sah18 earned 664 total points
ID: 35439833
Here is a step-by-step tutorial on how to insert a button into an Excel worksheet and then to assign a macro to it:

http://office.microsoft.com/en-us/excel-help/add-a-button-and-assign-a-macro-to-it-in-a-worksheet-HP010236676.aspx

The macro is the behavior that will occur when the button is clicked.  StephenJR has already provided the macro information that should work.

Hope this helps!
0
 
LVL 24

Expert Comment

by:StephenJR
ID: 35439854
Thanks sah18, missed that. Basically right-click the button and assign macro.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 34

Assisted Solution

by:Rob Henson
Rob Henson earned 668 total points
ID: 35439859
There is a standard button available for inserting rows.

In Excel 2003 - Right click on the toolbars and Select Customize. In the left hand pane select Insert and the right hand pane will change to show all buttons available, one of which is Insert Row.

Drag the Insert Rows button option to a tool bar.

Click Close. Job Done. This will then show for all files and will insert a row above the active row so if you specifically want it above row 2, ensure the active cell is in row 2 when clicking the button.

Cheers
Rob H
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 35440079
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

0
 

Author Closing Comment

by:TIMFOX123
ID: 35440251
Great job

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

thx
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question