Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default visual basic with Excel- how to move cursor right

I have a small Excel worksheet for which I have done a very short Visual
Basic program. I am not experienced at VB. Have looked through many books but
can find no answer. Is there a command I can use to move the cursor 3 columns
to the right? This seems to be a very basic thing to do in any spreadsheet,
but the answer eludes me. Any help? Please respond to .
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default visual basic with Excel- how to move cursor right

ActiveCell.Offset(0,3).Select

"countyworksheetthatfiguressickandvacatio" wrote:

I have a small Excel worksheet for which I have done a very short Visual
Basic program. I am not experienced at VB. Have looked through many books but
can find no answer. Is there a command I can use to move the cursor 3 columns
to the right? This seems to be a very basic thing to do in any spreadsheet,
but the answer eludes me. Any help? Please respond to .
Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 170
Default visual basic with Excel- how to move cursor right

Well, if you really need to move the active cell (aircode):
MyCell.Offset(0,3).Activate
and then put a value into it (remember that you've just changed the active
cell):
ActiveCell.Value = "new value"

Keep in mind that you frequently don't need to activate or select cells
within VBA as you would if you were in the user interface, or anywhere near
as much as the macro recorder might lead you to believe. :-) You can usually
refer to ranges/cells and manipulate them without actually selecting them.
Since Selection & Activation have a performance hit, learning when you can
safely avoid them can be a valuable tool.
MyCell.Offset(0,3).Value = "new value"
fills the same value into the same cell as the first example, but without
any activation.

FYI, when used with a range, the Cells(row,column) property behaves similar
to Offset(row, column) except it is 1 based rather than zero based.
True: MyCell.Offset(0,0).Address = MyCell.Cells(1,1).Address =
MyCell.Address

HTH,
--
George Nicholson

Remove 'Junk' from return address.


"countyworksheetthatfiguressickandvacatio"
<countyworksheetthatfiguressickandvacatio@discussi ons.microsoft.com wrote
in message ...
I have a small Excel worksheet for which I have done a very short Visual
Basic program. I am not experienced at VB. Have looked through many books
but
can find no answer. Is there a command I can use to move the cursor 3
columns
to the right? This seems to be a very basic thing to do in any
spreadsheet,
but the answer eludes me. Any help? Please respond to
.
Thanks.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic "Blinking" Cursor??? Ken Excel Discussion (Misc queries) 5 November 12th 08 04:00 PM
VISUAL BASIC COMMAND TO MOVE CURSER DOWN ONE CELL Moving Problem! Excel Worksheet Functions 2 December 19th 06 08:00 AM
Visual basic macro move cursor down 1 cell Roger Excel Worksheet Functions 1 September 12th 06 08:09 PM
changing the visual basic in office 2003 to visual studio net bigdaddy3 Excel Discussion (Misc queries) 1 September 13th 05 10:57 AM
Visual Basic Help Wizard/Index problem, can't get cursor HelpNeeded Excel Discussion (Misc queries) 3 March 4th 05 03:46 AM


All times are GMT +1. The time now is 05:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"