Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Visual Basic "Blinking" Cursor??? | Excel Discussion (Misc queries) | |||
VISUAL BASIC COMMAND TO MOVE CURSER DOWN ONE CELL | Excel Worksheet Functions | |||
Visual basic macro move cursor down 1 cell | Excel Worksheet Functions | |||
changing the visual basic in office 2003 to visual studio net | Excel Discussion (Misc queries) | |||
Visual Basic Help Wizard/Index problem, can't get cursor | Excel Discussion (Misc queries) |