[mso] Re: Excel 2002 Macro Help

I've tried Wilson's code and it works.

Just a tip (and I'm sorry if this is already obvious to you), click on the
statement in the VBA editor and press F9. The statement should turn to a
red background with a red blob in the column to the left. This puts a
breakpoint on that statement. Now run the macro from the Excel window and
it should switch to the VBA editor with the statement overlaid with yellow
and a yellow arrow in left margin. That means the code has stopped there.
Press F9 to turn breakpoint off and F5 to continue running the macro. At
least you now know whether you are actually executing the statement.

While you are at the breakpoint you could use F8 instead of F5. That just
executes one statement so you can try and see what's wrong. You can even
drag the yellow arrow back up to it's previous position and use F8 again
to re-execute the statement. You don't say what error you had, but if you
didn't know the above already it may help your debugging.

Regards, John

-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf
Of Christine
Sent: 29 April 2004 04:15
To: mso@xxxxxxxxxxxxx
Subject: [mso] Re: Excel 2002 Macro Help


Thanks Linda, I did turn toggle to relative, my problem was
it was relative to which cell was active, I need to make
sure it went to A1 on each sheet.  Also, I tried Wilson's
code, couldn't get it to work, I have to look at it again, which will
probably be Friday before I can get back to it at work, tomorrow other
stuff has to get done.

Christine

-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf
Of Linda F. Johnson
Sent: Wednesday, April 28, 2004 7:27 PM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Re: Excel 2002 Macro Help


I know Wilson probably gave you the code you wanted, Christine....but
since you are recording macros to learn how they look in code (which is
the best way to learn them I'm told, and I do it too)...I wanted to remind
you that on your macro recorder toolbar, there's a button to change the
macro between absolute and relative.  If the macro is relative, it will
insert the column to the left of whatever cell you are in when you run
it....however, if the macro is absolute, it will always go to column B
when you run it.  Don't forget that button is there :-)=20


Linda
Linda's Computer Stop
http://personal-computer-tutor.com
ABC Free Ezine ~ Free Ebooks and Tutorials
*all outgoing mail scanned by Norton AV.  If you got a bug
that looks like it came from me, it did NOT!

-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On Behalf
Of McDonald, Christine, Ms, DCAA
Sent: Wednesday, April 28, 2004 7:16 PM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Excel 2002 Macro Help

Hi all, I'm working on a complex macro to perform a  number
of tasks that I need to do to compare some data.  One of the things I need
it to do, is go to the specified worksheet, and insert a column to the
left of Column A.  This is what I have so far: Sheets("Previous
PP").Select
    ActiveCell.Columns("A:A").EntireColumn.Select
    Selection.Insert Shift:=3DxlToRight

What it is doing however, is inserting the column to the
left of whatever cell the cursor happens to be in.  So I
added an additional line so this portion of the macro looks like this now:
=20
    Sheets("Previous PP").Select
     Range("A1").Select
    ActiveCell.Columns("A:A").EntireColumn.Select
    Selection.Insert Shift:=3DxlToRight

Is this the best way to do this?  I realize my macro is probably not
written the most efficient way, but I started with recording the macro,
since I'm new to this, and modifying it to meet my needs and to be more
efficient as I learn more.

Thanks,

Christine McDonald


************************************************************
*
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to=20
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes)
in the subject line.

Or, visit the group's homepage and use the dropdown menu.
This will also allow you to change your email settings to digest or
vacation (no mail). http://www.freelists.org/webpage/mso

To be able to use the files section for sharing files with
the group, send a request to mso-moderators@xxxxxxxxxxxxx
and you will be sent an invitation with instructions.  Once
you are a member of the files group, you can go here to upload/download
files: http://www.smartgroups.com/vault/msofiles
************************************************************
*


*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes)
in the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also
allow you to change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send
a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an
invitation with instructions.  Once you are a member of the files group,
you can go here to upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************


*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: