Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Use VB to move to adjacent cell

Hello,

I know that this is a simple question, but I can't find the answer. I have
the VB code to find a cell in a worksheet. I would then like to have the
adjacent cell to the right highlighted. What is the code for that?

Thanks
B
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Use VB to move to adjacent cell

Dim Foundcell as range

set foundcell = yourfindgoeshere

if foundcell is nothing then
beep
else
foundcell.offset(0,1).select
end with

(assuming you're finding on the activesheet.)

Bstice wrote:

Hello,

I know that this is a simple question, but I can't find the answer. I have
the VB code to find a cell in a worksheet. I would then like to have the
adjacent cell to the right highlighted. What is the code for that?

Thanks
B


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Use VB to move to adjacent cell

Try something like

Dim FoundCell As Range
Set FoundCell Cells.Find(....)
If Not FoundCell Is Nothing Then
FoundCell(1,2).Select
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting LLC
www.cpearson.com
(email on the web site)

"Bstice" wrote in message
...
Hello,

I know that this is a simple question, but I can't find the answer. I
have
the VB code to find a cell in a worksheet. I would then like to have the
adjacent cell to the right highlighted. What is the code for that?

Thanks
B


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Use VB to move to adjacent cell

If your VB code identifies a cell:

rngFoundCell.Offset(, 1).Select

If it just selects a cell:

ActiveCell.Offset(, 1).Select

__________________________________________________ ______________________


"Bstice" wrote in message
...
Hello,

I know that this is a simple question, but I can't find the answer. I
have
the VB code to find a cell in a worksheet. I would then like to have the
adjacent cell to the right highlighted. What is the code for that?

Thanks
B



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Use VB to move to adjacent cell

I need to become a lot faster to beat Dave and Chip!
__________________________________________________ ______________________

"Vasant Nanavati" <vasantn AT aol DOT com wrote in message
...
If your VB code identifies a cell:

rngFoundCell.Offset(, 1).Select

If it just selects a cell:

ActiveCell.Offset(, 1).Select

__________________________________________________ ______________________


"Bstice" wrote in message
...
Hello,

I know that this is a simple question, but I can't find the answer. I
have
the VB code to find a cell in a worksheet. I would then like to have the
adjacent cell to the right highlighted. What is the code for that?

Thanks
B





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
Automatically move to adjacent cells without hitting Enter Doug Excel Discussion (Misc queries) 7 August 11th 09 07:14 PM
move to adjacent cell with panes frozen Aaron Excel Discussion (Misc queries) 1 October 5th 06 10:45 AM
How to Automatically Move Cell datato adjacent cell.. cardingtr Excel Discussion (Misc queries) 1 October 17th 05 03:59 AM
tab does not move to adjacent cell in excel Karen Boyd Excel Discussion (Misc queries) 1 September 21st 05 07:09 PM
excel tab key to move to right adjacent cell dwillie Excel Discussion (Misc queries) 2 January 26th 05 08:01 PM


All times are GMT +1. The time now is 03:47 PM.

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

About Us

"It's about Microsoft Excel"