Re: Excel 2007 Macro Help

  • From: "Dale Leavens" <dleavens@xxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Mon, 30 Aug 2010 15:36:59 -0400

I would use the Record Macro function in the Tools menu.

Put the cursor on the first line you want to swap then start the Record Macro.

Select the line with Shift Home 
Cut to clipboard CTRL-X
Arrow down a line
Insert row
Paste line into inserted row
Stop Record Macro.

Check it out, if necessary you can edit the VB code to fix anything you did 
wrong or any extra steps.

Sometimes I have to do these things a couple of times before I get them right. 
As I describe this I realize that the copy from clipboard might insert a row 
for you.

Hope this helps. The Record Macro is a pretty cool way of generating a bunch of 
code. You can often minimize the code later or make it more efficient but for a 
quick function like that I think you will find it runs plenty fast enough 
without having to optimize.

Dale leavens.





  ----- Original Message ----- 
  From: Homme, James 
  To: programmingblind@xxxxxxxxxxxxx 
  Sent: Monday, August 30, 2010 3:21 PM
  Subject: Excel 2007 Macro Help


  Hi,

  I want to create an Excel 2007 macro that swaps the current row with the one 
below it. Does anyone have any documentation on how to do this?

   

  Thanks.

   

  Jim

   

  Jim Homme,

  Usability Services,

  Phone: 412-544-1810. Skype: jim.homme

  Internal recipients,  Read my accessibility blog. Discuss accessibility here. 
Accessibility Wiki: Breaking news and accessibility advice

   



------------------------------------------------------------------------------
  This e-mail and any attachments to it are confidential and are intended 
solely for use of the individual or entity to whom they are addressed. If you 
have received this e-mail in error, please notify the sender immediately and 
then delete it. If you are not the intended recipient, you must not keep, use, 
disclose, copy or distribute this e-mail without the author's prior permission. 
The views expressed in this e-mail message do not necessarily represent the 
views of Highmark Inc., its subsidiaries, or affiliates.

Other related posts: