Page 1 of 2 12 LastLast
Results 1 to 10 of 12

move active cell one to the right - excel 2000

This is a discussion on move active cell one to the right - excel 2000 within the Excel Questions forums, part of the Question Forums category; Hi. I'm not real good with code/macros. I would love to purchase some kind of material to ameliorate this condition ...

  1. #1
    New Member
    Join Date
    Dec 2003
    Location
    Liangshan Marsh, Middle Kingdom
    Posts
    35

    Default move active cell one to the right - excel 2000

    Hi. I'm not real good with code/macros. I would love to purchase some kind of material to ameliorate this condition rather than pestering generous comrades such as yourselves, but I don't have a real reliable mailing address here in the Middle Kingdom, and rest assured that there is a dearth of English language materials on the subject.

    What is the command to move the active cell? For example, suppose C15 is the active cell, and I want a macro to move the active cell one to the right. Or maybe 3 to the right, and one down. The deal is, I'd like to be able to make the active cell move in a fixed pattern relative to the cell that is already active (before the macro is run), rather than moving to a final fixed destination (which would be something that even I could figure out). In other words, if I select R20, and run the macro (or whatever other mechanism you guys come up with), then R21 will be selected; likewise, I can click G12, run the macro, and G13 will be selected.

    Thanks,

    Outlaw

  2. #2
    Board Regular SIXTH SENSE's Avatar
    Join Date
    Oct 2003
    Posts
    1,884

    Default

    hi!
    try this one!
    row=0
    clms=1
    activecell.offset(rw,clms).seect

    this moves you one cell to the right.
    There is always a better way!!

  3. #3
    Board Regular TryingToLearn's Avatar
    Join Date
    Sep 2003
    Location
    NJ
    Posts
    692

    Default Re: move active cell one to the right - excel 2000

    try:

    activecell.offset(r,c).select

    where r = # of rows you want to move (-r if you want to move up)
    c = # of columns to move (-r if you want to move left)

    so in your example it would be

    activecell.offset(0,1).select

    HTH
    -Bob [XL2003 & 7 on XP] Slowly coming out of the Stone Age and trying to trade in my abacus.

  4. #4
    MrExcel MVP
    Join Date
    Apr 2002
    Location
    Vancouver BC , Canada
    Posts
    6,259

    Default Re: move active cell one to the right - excel 2000

    Hello OutlawoftheMarsh

    What are you wanting the "Macro" to do beyond selecting another cell? Do you have some code you could show us ?
    The reason I ask is it's always a good Idea to avoid "selection" as much as possible in your code

    <MARQUEE>...........Never be afraid to try something new. Remember, amateurs built the ark, professionals built the Titanic...............The easiest thing to find is fault, don't be easy !.. --Anonymous--...</marquee>

  5. #5
    New Member
    Join Date
    Dec 2003
    Location
    Liangshan Marsh, Middle Kingdom
    Posts
    35

    Default Re: move active cell one to the right - excel 2000

    Thanks, SixthSense and TryingToLearn. That's precisely what I was looking for.

    In response to Nimrod's comment, I don't exactly have a total plan for the macro. Mostly I'm just trying to get a grip on some of the basic commands, so when I do need a macro, I'll have some kind of idea how to go about creating it. For changing cell focus, I was kind of kicking around this idea of activating some kind of cheesy "animation" - filling some surrounding cells with a certain color or something along those lines. I know I'll need a lot more practice and knowledge before I can create something that isn't just plain laughable, but I've got to start somewhere.

    Cheers!

    Outlaw

  6. #6
    MrExcel MVP
    Join Date
    Apr 2002
    Location
    Vancouver BC , Canada
    Posts
    6,259

    Default Re: move active cell one to the right - excel 2000

    Hell0 Outlawofthemarsh:

    Then one of the first things you need to do is learn how to get away from using "selects" to reference cells and values. One of the most valuabel things you can do is read the section in VBA help on cell referencing. And the best article in VBA help for this is :
    1. Goto VBA help and type in "Range"
    2. in the article list select "How to Reference Cells and Ranges".

    I cant stress enough how important this material is for proper coding

    <MARQUEE>...........Never be afraid to try something new. Remember, amateurs built the ark, professionals built the Titanic...............The easiest thing to find is fault, don't be easy !.. --Anonymous--...</marquee>

  7. #7
    New Member
    Join Date
    Dec 2003
    Location
    Liangshan Marsh, Middle Kingdom
    Posts
    35

    Default Re: move active cell one to the right - excel 2000

    Hi, Nimrod.

    Thanks for the tip. I was just reading one of your posts regarding someone's click box quandary wherein you more poignantly elucidated your animosity (if I can call it that) for selection. Anyhow, thanks again for the guidance. I looked through that article a bit, and it looks like good stuff.

    Outlaw

  8. #8
    Board Regular TryingToLearn's Avatar
    Join Date
    Sep 2003
    Location
    NJ
    Posts
    692

    Default Re: move active cell one to the right - excel 2000

    Gee, if only they provided help on help , more people like me would have found this stuff on my own. Almost ready to throw out the excedrin now
    -Bob [XL2003 & 7 on XP] Slowly coming out of the Stone Age and trying to trade in my abacus.

  9. #9
    MrExcel MVP
    Join Date
    Apr 2002
    Location
    Vancouver BC , Canada
    Posts
    6,259

    Default Re: move active cell one to the right - excel 2000

    Hello TryingToLearn & Outlaw;
    Glad I could help .... another good item to read up on is the "For ...each..in"
    Good luck with your coding

    <MARQUEE>...........Never be afraid to try something new. Remember, amateurs built the ark, professionals built the Titanic...............The easiest thing to find is fault, don't be easy !.. --Anonymous--...</marquee>

  10. #10
    MrExcel MVP
    Join Date
    Apr 2002
    Location
    Vancouver BC , Canada
    Posts
    6,259

    Default Re: move active cell one to the right - excel 2000

    Hello TryingToLearn & Outlaw;
    Glad I could help .... another good item to read up on is the "For ...each..in"
    Good luck with your coding

    <MARQUEE>...........Never be afraid to try something new. Remember, amateurs built the ark, professionals built the Titanic...............The easiest thing to find is fault, don't be easy !.. --Anonymous--...</marquee>

Page 1 of 2 12 LastLast

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com