move active cell one to the right - excel 2000

OutlawoftheMarsh

New Member
Joined
Dec 11, 2003
Messages
35
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
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
hi!
try this one!
row=0
clms=1
activecell.offset(rw,clms).seect

this moves you one cell to the right.
 
Upvote 0
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
 
Upvote 0
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 :)
 
Upvote 0
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
 
Upvote 0
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 :wink:
 
Upvote 0
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
 
Upvote 0
Gee, if only they provided help on help :oops: , more people like me would have found this stuff on my own. Almost ready to throw out the excedrin now :biggrin:
 
Upvote 0
Hello TryingToLearn & Outlaw;
Glad I could help .... another good item to read up on is the "For ...each..in" :wink:
Good luck with your coding :biggrin:
 
Upvote 0
Hello TryingToLearn & Outlaw;
Glad I could help .... another good item to read up on is the "For ...each..in" :wink:
Good luck with your coding :biggrin:
 
Upvote 0

Forum statistics

Threads
1,213,487
Messages
6,113,937
Members
448,534
Latest member
benefuexx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top