All I want to do is create a macro that does the following in excel: {f2}{home}'{enter}{down}
I've tried sendkeys but the {f2} seems to be ignored.
This will insert an apostrophe at the beginning of each cell that I run it in.
How do I create lotus type macros in excel?
Hi. Like you, I too miss the days of the Lotus macros/scripting. Lotus macro language was far simpler to understand. It was so intuitive. I tried writing scripts in Excel the first few years after Microsfot conquered the office space (~1994-1998), and after hours upon hours of trying to understand its heiroglyphics in an attempt to create a macro for a repetitive task that would have taken me ~60 second to write in Lotus, I gave up and have since only been tempted into this highly cryptic world on a handful of occassions. I have little idea still of what I am doing in teh Microsoft Excel Macro Edior. However, I think I do at leats kmow how to bang out something to do what wish. Try this:
Sub Macro1()
var1 = ActiveCell.Value
ActiveCell.Value = "'" %26amp; var1
ActiveCell.Offset(1, 0).Select
End Sub
I think it does exactly as the keystrokes you described does, except it sounds as though you may want one more "DOWN" command, i.e., "ActiveCell.Offset(1, 0).Select".
Hope this helps.
Reply:Excel can record your actions into a macro. This is usually a good starting point to get the macro you want. The macro recorder is found in 'Tools'%26gt;'Macro'%26gt;'Record new macro' from the menu bar. This will put your new macro on a special macro-page in your excel file where you can edit the visual basic to do whatever -- including switching between applications which support VB macros.
Reply:If you are running this in Excel, then this should serve your purpose.
---x---
Sub Macro1()
ActiveCell.FormulaR1C1 = "'"
ActiveCell.Offset(1, 0).Select
End Sub
---x---
Assign a short cut key to the macro. You should be all set.
=====x=====
if you want it to run for specified number of cells, then I would suggest using a "For" loop so that you need not run it all the time.
Dog Teeth
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment