Excel Macro - Moving cursor in Worksheet

I am writing a macro and cannot find any command that will 
allow me to move the cursor in the Worksheet. Rather than 
give a Cell address such as "A3" I want to be able to move 
the cursor any given number of cells to the right,left, up 
or down.
Can anyone help?
s.king (1)
10/2/2003 3:52:37 AM
excel.misc 78881 articles. 5 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 30


will move x rows down (if positive, up if negative) and y columns to the right
(if positive, left if negative).

Stephen King wrote:
> I am writing a macro and cannot find any command that will
> allow me to move the cursor in the Worksheet. Rather than
> give a Cell address such as "A3" I want to be able to move
> the cursor any given number of cells to the right,left, up
> or down.
> Can anyone help?


Dave Peterson
ec35720 (10082)
10/2/2003 4:15:39 AM
Another thing you may find very useful is:

has the same result as ctl+down in the spreadsheet, or

range(selection, selection.end(xldown)).select
has the same result as ctl+shft+down in the spreadsheet

Likewise with xlup, xltoright, xltoleft.

Note: if your current range is a single cell, it will do 
what you instinctively expect. If your current range is, 
say, an entire row, xldown will select entire rows and so 

Nikos Y.

>-----Original Message-----
>I am writing a macro and cannot find any command that 
>allow me to move the cursor in the Worksheet. Rather than 
>give a Cell address such as "A3" I want to be able to 
>the cursor any given number of cells to the right,left, 
>or down.
>Can anyone help?
nyannaco (9)
10/2/2003 8:45:24 AM

Similar Artilces:

Shared excel file dissapears
We use a shared excel 2000 xls file shared on a w2k server as a production log. we now have about 30 users with about 12 users constantly editing. As we add more users the dissapearances seem to mount up. we are at about 2 a day now. I was wondering what the max amount vs the recommended amount of simultaneous users are. Are there any known issues which would cause excel to mysteriously vanish?? thanks cr -- http://QLiner.com It has been said that democracy is the worst form of government except all the others that have been tried. - Winston Churchill ...

2007 Excel Workbook multiple worksheets I want 1 chart
I have Blood Pressure Monitoring series. where A = Day of Week Month Year as Wednesday Apr 1-09-9:30am this is a text value not a date as Excel always fouls up the time. Days of the month are 1 - 31 or 1 - 30 or 1-28/29 B= Diastolic Pressure as Number no decimal places C= Systolic Pressure as Number no decimal places D= Pulse rate as number no decimal places I can create a chart for each month. With each month or single for each month on separate sheet. Each month is formated and arranged the same. How do I set the chart data range for all months or any multiple of months 14, 2, 3 o...

Copy Excel email addresses to GroupWise
I have an Excel worksheet that has a column that contains email addresses. I would like to copy some of the email addresses into GroupWise. When I select certain email addresses and copy and paste them into GroupWise. For some reason I get the email addresses in between the emails that I have selected. Examples: sbradfor@salliemae.com bbarrett@salliemae.com sblackbu@salliemae.com dwalker@salliemae.com mbrown@salliemae.com If I selected sbradfor@salliemae.com, sblackbu@salliemae.com, and mbrown@salliemae.com and pasted into GroupWise, I would receive all of the addressesin the TO: f...

Macro syntax to open file in current explorer folder
Pt 1 : MS Excel 97 SR-2 ----------------------- I would like to use a macro code line starting Workbooks.OpenText FileName:=".\AmsAll-1.prn", _ to open the tab delimited file "AmsAll-1.prn" in the folder from which I launch the Excel application. However the ".\" path qualifier always reverts to the C: drive, not the K: mapped drive that I access all my project files from. It is inconvenient to navigate several levels down to the project from C:\ just to run this one application. The following does work : Workbooks.OpenText FileName:="k:.\AmsAll-1...

Move Mailbox Fails
All: Having a sporadic issue with my Exchange 2003 server. I am in the final phases of a 5.5 migration and on occasssionally, the move mailbox command fails with 3 errors. If I try it again it will work. Very odd. I get these errors when it fails: 9175 The MAPI call 'OpenMsgStore' failed with the following error: The attempt to log on to the Microsoft Exchange Server computer has failed. The MAPI provider failed. Microsoft Exchange Server Information Store ID no: 8004011d-0512-00000000 9167 Unable to get an administrative interface to the mailbox store on server 'EX1'. ...

axis font excel chart?
how can I change the font of the scale in an excel chart? Right-click on the relevant axis. Format Axis/ Font/ Size: -- David Biddulph "ColinB" <ColinB@discussions.microsoft.com> wrote in message news:6B1096F8-87B3-4642-BCC8-0EEE11FE0DED@microsoft.com... > how can I change the font of the scale in an excel chart? ...

Interactions - Export to Excel
Folks: Need your help ! I am trying to pull an acitivty report in CRM. If I go to the Interactions page, and then click on “edit View” icon over on the right hand side, and complete the drop downs, if I export to Excel, I get an error message that reads: Argument ‘Index’ is not a valid value. I get this error only for Interactions and not with any other workplace. We are on CRM 3.0 .- SQL Server 2005 Thanks ! ...

Including Images in Excel Report Builder
We have a client that is attaching jpgs to the item maintenance window in GP and they want an Excel Report Builder report of each inventory item along with its image. It seems that the file name is stored in hex format. Is it possible to include a reference to the image location in an Excel Report Builder report, so the report can include the image inside of Excel? Thanks ...

Open Excel workbook maximized from Access
I found the code Application.FollowHyperlink in the newsgroups, which works well to open the workbook from a button on an Access form. But I want the worksheet to open maximized, rather than "floating" in the Excel window. What can I add to my code to do this? It reads: Application.FollowHyperlink "path/nameof workbook.xls" Or do I need to do this another way? Can I do something in the workbook? (Not too familiar with Excel.) Thanks for your help. -- susan ...

Linking cells in a worksheet to other worksheets in a workbook
I'd like to be able to link a cell in one worksheet to another worksheet, so that when I click on the cell in the first worksheet, the other worksheet opens up. I have a spreadsheet where the first page (worksheet) has a listing of items contained in other tabs (worksheets). I'd like to be able to click on the first worksheet "index" and have the appropriate worksheet pop open with the contents of the index. Thanks for your responses! (In Excel 2003) Select a cell to which you would like to add a link. Select Insert->Hyperlink. Click the "Place in this doc...

excel locks up after selecting a cell #2
excel locks up after selecting a cell. When ever, I select a Cell, that will automatically selects all the cell and this freezes the entire computer. Can any body who would help me resolve this issue? Please help.... ...

Where has the data map tool gone to in Excel 2003?
Cannot find it in 2003. Was there in earlier versions of Excel. It's gone as of Exel 2002. Here is MS's statement and a link to another program for map making. http://office.microsoft.com/en-us/assistance/HA010346591033.aspx tj "macray" wrote: > Cannot find it in 2003. Was there in earlier versions of Excel. If it still resides on the hard drive, you can use it from later Excel versions, through the Insert Object dialog. But I think uninstallation is pretty good at wiping it out. In my case, I have multiple versions of Excel installed on one machine, so Excel 2003...

Macro for Internet Order Window
I want to create a macro to launch the CTL-SHIFT-F10 "Internet order" button (because I am going to make a custom button for it). However, I cannot record the macro because as soon as I hit CTRL-SHIFT-F10, the order popup window pops up and I cannot end the macro by doing SHIFT-F3. If I close the window, then hit SHIFT-F3 to end the macro, the macro just opens and then closes the internet order window. Is there another way to do it? Thanks, mickie No ideas? No one has done this? Mickie wrote: > I want to create a macro to launch the CTL-SHIFT-F10 "Int...

Stop excel from reporting replacements
How do I get excel from popping up the window that tells how many entries its replaced when I do a Ctrl-H. I have to edit a lot of entries and this is something I didn't have to put up with in Office 97 I'm not sure you can stop it (I couldn't). But if your fingers are on the keyboard, hit the enter key to dismiss it. (Or try hitting the enter key twice really quickly (with replace all having focus). It might not be noticeable (much). Chris wrote: > > How do I get excel from popping up the window that tells how many entries its > replaced when I do a Ctrl-H. I ha...

Changing of Cell protections after saving Excel File (2002)
This problem occurs when I protect a document using a macro 4.0 function: =PROTECT.DOCUMENT(TRUE,,,TRUE,TRUE). When I use the function within a macro4.0 macro, on an original file, everything works fine. The sheet has unlocked cells, and when the sheet is protected, it allows me to access those cells. But if I save the file, or save.as another name, then the fun begins. The enable selection of the sheet( view codes) has gone from 0-xlNoRestrictions to -4142- xlNoSelection. This locks me out of doing anything in the sheet. When I unprotect and then re-protect the sheet using the T...

Help with macro/and or formula?
Perhaps this is a silly question, but i just can't figure out how t format this worksheet. The problem is that a lot of the cells hav numbers in them with negative signs in the back instead of in the fron (ie. 23-) and i was wondering if anyone knew of a macro/formula i coul use to quickly fix this problem for all the cells. I would b extremely grateful. Thanks -- brefed1 ----------------------------------------------------------------------- brefed15's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3557 View this thread: http://www.excelforum.com/showthre...

Check box to click on in excel or word
I am needing to add a shadow outlined box that you can click on in a document in either word or excel. I did it in the old excel but I'm having difficulty in the new Microsoft Office. The old and the new Office?...which versions would that be...nevermind...actually you should ask this in an Excel newsgroup this one is for Publisher (a desktop publishing program). -- ~~~~~~~~~~~~~~~~~~ Rob Giordano Microsoft MVP Expression Web "ThePools" <ThePools@discussions.microsoft.com> wrote in message news:24A86070-537B-404A-A39B-CFC06CAECBA0@microsoft.c...

Can't Email to Moved Domain
We had a sister company operating within our WAN. We hosted their mail on our single Exch 2003 server. This company was sold and moved off of our servers. We removed all of their information from our Exchange server. I have deleted all of their mailboxes, AD user accounts, any reference to their domain in the recipient policies, and any entries in our dns system for their domain name. Still, when we try to send messages to these people at their new location we get an NDR that says "The e-mail account does not exist at the organization this message was sent to. Check the e-mail addr...

Pasting in Excel has started taking a long time.
Copying or cutting then pasting on same or another sheet a range of cells in Excel has started to take ages. Nothing complicated just data. Does this happen with a new workbook or only specific workbooks? try opening a new workbook and perform a copy and paste with a samll amount of data. Yo umnay have a problem with the memory associated with the clipboard or your temporary drive on your PC. does the problem happen with other applications besides excel? -- joel ------------------------------------------------------------------------ joel's Profile: http://www.thecode...

when starting excel, .doc & .dat file come up ?????
When I got my new computer at work XP Pro operating, w/2003 Office pro, every time I open Excel, about 12 .doc & .dat file pop up saying not excel format files, and I have to say close to everyone. Then, if automatically defaults to opening an excel file that is someone elses. I have tried running a repair, uninstalling and reinstalling, and nothing works. Never, have I had anything like this happen in my fifteen years. Any suggestions????? HELP it really slows me down. -- thankssomuch The first place I'd check is: Tools|Options|General Tab Make sure that the "at star...

Excel Incorrectly Plotting Non-sequential Data Points
I am plotting a chart in Excel 2003 using non-sequential data points as shown below. Time Value 0 0.07 2 0.09 4 0.14 6 0.10 9 0.08 10 0.09 Excel, however, plots them in order as if they were: Time Value 1 0.07 2 0.09 3 0.14 4 0.10 5 0.08 6 0.09 When I look at the Source Data, it highlights the right data, but just seems to plot it incorrectly. Could this be a formatting error? Any help is VERY appreciated. Aaron, Select both columns (not j...

in creating a pie chart in excel 2007
How many rows or columns of data can the pie chart plot I once tried 360 cells and got a wonderful Moiré pattern Why not just experiment with 1, 2, 3 dozen and see for yourself if the result is acceptable ? best wishes -- Bernard Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme "bsalohcin" <bsalohcin@discussions.microsoft.com> wrote in message news:F9CF7752-1816-4DCE-BF82-9C25033AE888@microsoft.com... > How many rows or columns of data can the pie chart plot According to MS:- Data series in one chart 255 (max limit) Data points in a...

How do I make a particular column required in Excel? #2
Our NPO is creating a reimbursement chart in Excel. We're trying to make it so that if employees do not fill in one particular column entitled "Projects," they will get an error or will be unable to have a final sum filled in. Is there any way I can make this particular column required so that if it is not filled in, the chart will not complete properly? Thank you in advance for any advice or help--I'm a bit of a novice to this! ...

Excel Events Conflict with VB and C# AddIns
Hi, I have two com addins running in Excel. One is written in VB and the other in C#. Both addins are interested in the Workbookopen event. When the event is triggered the c# code captures the event but the VB code does not. If i disable the c# addin then the vb code works. Looks like the c# addin is somehow blocking the vb events. Anyone know how to fix this? Many thanks, Andy There is only one WorkbookOpen event, so once one add-in hooks it, there is nothing for the other one to hook. If you are hooking the WorkbookOpen event in your add-ins, this is likely your problem. You may need...

Portrait only printing in Excel
I have an interesting problem. I have a workstation (Dell Pentium IV XP PRO) that has Office 2k on it. When I/we try to print to a networked printer, the document will only print in portrait no matter what changes I make to page settings or printer settings. We are on Active Directory, so as long as the documents are submitted from a different computer, it will print fine. Any suggestions? This could be a complete waste of your time, but the first thing I'd try is to reinstall the printer driver. (maybe even get a fresh driver from the printer manufacturer's web site???) Howa...