Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I have 3 buttons in the same worksheet to copy a row and insert the same below it. I have this macro running for 3 different places. See my code below. The problem is: 1) I want just the formulas/formatting to be pasted, and not the constants. 2) And more importantly, if I use Button 1, then a row is added below row 15 and the rows move down and so for Button 2, row 36 is different now as it has moved down, if you understand? How do I keep it fixed that it always copies row 36 even if a row is added above and the rows move down. Same for Button 3. Private Sub CommandButton1_Click() Range("15:15").Select Selection.Copy Selection.Insert Shift:=xlDown End Sub Private Sub CommandButton2_Click() Range("36:36").Select Selection.Copy Selection.Insert Shift:=xlDown End Sub Private Sub CommandButton3_Click() Range("41:41").Select Selection.Copy Selection.Insert Shift:=xlDown End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying and Pasting Different Formulas | Excel Programming | |||
Copying/Pasting Formulas | Excel Discussion (Misc queries) | |||
Copying and pasting multiple formulas, it it possible? | Excel Discussion (Misc queries) | |||
Copying & pasting formulas | Excel Worksheet Functions | |||
Pasting formulas without copying file ref. | Excel Programming |