E
EB
I wrote the following macro and assigned it to a button a few years ago, I
don't know under which version of Excel. It still works. I created it by
entering commands manualy and having it recorded as a macro.
===========
Sub Button9_Click()
Application.Goto Reference:="e"
Selection.EntireRow.Insert
SendKeys "{UP}", True
SendKeys "+{RIGHT}+{RIGHT}+{RIGHT}+{RIGHT}+{RIGHT}", True
SendKeys "+{RIGHT}+{RIGHT}+{RIGHT}+{RIGHT}+{RIGHT}", True
SendKeys "+{RIGHT}", True
SendKeys "^{c}{DOWN}{ENTER}", True
Application.Goto Reference:="e"
SendKeys "{DOWN}{RIGHT}{RIGHT}", True
ActiveCell.FormulaR1C1 = "=RC[-1]+R[-2]C[5]"
Application.Goto Reference:="e"
SendKeys "{UP}", True
End Sub
===========
1) I can run the macro under XP.
2) I cannot run it under Vista. As soon as it hits the first SendKey, it
complains about some security breach.
3) I can not rerecird it from scratch under any new Excel (Vista or XP). It
doesn't generate SendKeys. It just moves to the final cell. Which is useless
because I'd like to get there dynamiccaly based on the orig cell.
Any help will be appriciated.
EB
don't know under which version of Excel. It still works. I created it by
entering commands manualy and having it recorded as a macro.
===========
Sub Button9_Click()
Application.Goto Reference:="e"
Selection.EntireRow.Insert
SendKeys "{UP}", True
SendKeys "+{RIGHT}+{RIGHT}+{RIGHT}+{RIGHT}+{RIGHT}", True
SendKeys "+{RIGHT}+{RIGHT}+{RIGHT}+{RIGHT}+{RIGHT}", True
SendKeys "+{RIGHT}", True
SendKeys "^{c}{DOWN}{ENTER}", True
Application.Goto Reference:="e"
SendKeys "{DOWN}{RIGHT}{RIGHT}", True
ActiveCell.FormulaR1C1 = "=RC[-1]+R[-2]C[5]"
Application.Goto Reference:="e"
SendKeys "{UP}", True
End Sub
===========
1) I can run the macro under XP.
2) I cannot run it under Vista. As soon as it hits the first SendKey, it
complains about some security breach.
3) I can not rerecird it from scratch under any new Excel (Vista or XP). It
doesn't generate SendKeys. It just moves to the final cell. Which is useless
because I'd like to get there dynamiccaly based on the orig cell.
Any help will be appriciated.
EB