Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Row *below* button position - no need to copy formulas
Good Afternoon -
I am trying to program a button to insert a row below the row that the button is in, even though that might change. I have no necessity to copy the formulas to the inserted cells. I will give a more detailed explanation; How to make pie - Version 1 - updated 1/1/2006 - *Button to make new row* How to make pancakes - Version 1 -updated 1/1/2006 *Button to make new row* How to make ice cream - Version 1 - updated 1/1/2006 *Button to make new row* After I've entered a new version of How to Make Pie - the button for How to make pancakes has moved down, and would no longer insert a row below if i specify where it should insert. Is there a way to say, "insert a row from where this button is" instead of "insert a row from where the cursor is? (obviously not the real project, can you tell I'm hungry?) Thank you for any help you can provide. Katie |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Insert Row *below* button position - no need to copy formulas
This will do it:
In each CommandButton_Click code put this Private Sub CommandButton1_Click() BRow = Sheet1.CommandButton1.TopLeftCell.Row InsertRow End Sub Private Sub CommandButton2_Click() BRow = Sheet1.CommandButton2.TopLeftCell.Row InsertRow End Sub Private Sub CommandButton3_Click() BRow = Sheet1.CommandButton3.TopLeftCell.Row InsertRow End Sub etc for each button. Then in a standard code module put this: Public BRow As Long Sub InsertRow() Sheet1.Rows(BRow + 1).Insert Shift:=xlDown End Sub Mike F "Katie" wrote in message ... Good Afternoon - I am trying to program a button to insert a row below the row that the button is in, even though that might change. I have no necessity to copy the formulas to the inserted cells. I will give a more detailed explanation; How to make pie - Version 1 - updated 1/1/2006 - *Button to make new row* How to make pancakes - Version 1 -updated 1/1/2006 *Button to make new row* How to make ice cream - Version 1 - updated 1/1/2006 *Button to make new row* After I've entered a new version of How to Make Pie - the button for How to make pancakes has moved down, and would no longer insert a row below if i specify where it should insert. Is there a way to say, "insert a row from where this button is" instead of "insert a row from where the cursor is? (obviously not the real project, can you tell I'm hungry?) Thank you for any help you can provide. Katie |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Insert row and copy formulas | Excel Discussion (Misc queries) | |||
Macro: Insert Blank Row with formulas uses absolute position probl | Excel Discussion (Misc queries) | |||
insert row above button (retrieve position of button) | Excel Discussion (Misc queries) | |||
Macro to insert copy and insert formulas only to next blank row | Excel Programming | |||
Insert Row and copy formulas | Excel Programming |