Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving one cell over to the right

using VB code, i need to move over to the right 1 cell.

For example, i search for something and it finds it in cell b1, i nee
a script that will then highlight the cell in c1.

Sometimes, though the item i search for can be in cell D46 or a rando
area..

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving one cell over to the right

I fixed my dilemma...

here's the code:

ActiveCell.Offset(rowOffset:=0, columnOffset:=1).Activate


---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Moving one cell over to the right

See the VBA help for Offset

Try something like this

Sub test()
On Error GoTo a
Range("a1:a100").Find("ron").Offset(0, 1).Select
Exit Sub
a: MsgBox "nothing found"
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"alexm999 " wrote in message ...
using VB code, i need to move over to the right 1 cell.

For example, i search for something and it finds it in cell b1, i need
a script that will then highlight the cell in c1.

Sometimes, though the item i search for can be in cell D46 or a random
area...


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving one cell over to the right

Whats the script for the following:

If I look for a something and it's not there, what can i use to do
nothing and look for something else?


---
Message posted from http://www.ExcelForum.com/

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Moving one cell over to the right

Try Something like this

Sub test()
Dim rng As Range
On Error Resume Next
Set rng = Range("a1:a100").Find("ron")
If rng Is Nothing Then
Set rng = Range("a1:a100").Find("dave")
End If
If Not rng Is Nothing Then
rng.Offset(0, 1).Select
Else
MsgBox "nothing found"
End If
End Sub


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"alexm999 " wrote in message ...
Whats the script for the following:

If I look for a something and it's not there, what can i use to do
nothing and look for something else?


---
Message posted from http://www.ExcelForum.com/



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
Arrow keys moving whole excel sprdsht insted of from cell to cell Ms-Exl-Learner New Users to Excel 2 December 17th 09 07:20 AM
Arrow keys move screen instead of moving from cell to cell LuisGe Excel Discussion (Misc queries) 3 May 22nd 09 11:17 PM
Moving cell contents to new cell loses background color in old cel John Excel Discussion (Misc queries) 4 May 11th 09 01:56 AM
Arrows not moving from cell to cell, when I push arrow columns m Luanne Excel Discussion (Misc queries) 2 December 11th 08 07:24 PM
Force user to enter data in cell before moving to next cell Fusionmags New Users to Excel 3 November 19th 06 11:49 PM


All times are GMT +1. The time now is 10:56 AM.

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"