Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selecting cell next to a value

Hi,

I need to look at a column and search for the cell that
contains "Grand Total" and select the cell that is to the
left of that cell. Is there a way to do this? Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Selecting cell next to a value

Set oCell = Cells.Fins("Grand Total")
If Not oCell Is Nothing Then
oCelol.Offset(0,-1).Select
End If

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"KimH" wrote in message
...
Hi,

I need to look at a column and search for the cell that
contains "Grand Total" and select the cell that is to the
left of that cell. Is there a way to do this? Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Selecting cell next to a value

This should do:
Sub test()
Dim r As Range
On Error Resume Next
Set r = ActiveSheet.Cells.Find("Grand Total", , xlValues, xlWhole,
xlByRows, xlNext, False).Offset(0, -1)
If Err = 0 Then MsgBox r.Value Else MsgBox "Can't find GrandTotal"
End Sub

keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"KimH" wrote:

Hi,

I need to look at a column and search for the cell that
contains "Grand Total" and select the cell that is to the
left of that cell. Is there a way to do this? Thanks


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Selecting cell next to a value

Hi
Please amend accordingly:
With Worksheets(1).Range("a1:C500")
Set c = .Find("Grand Total", LookIn:=xlValues)
If Not c Is Nothing Then
c.Offset(0, -1).Select
End If
End With

HTH
Regards

"KimH" a écrit dans le message de
...
Hi,

I need to look at a column and search for the cell that
contains "Grand Total" and select the cell that is to the
left of that cell. Is there a way to do this? Thanks



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Selecting cell next to a value

Try this for column B

Sub Find_First()
Dim FindString As String
Dim Rng As Range
FindString = "Grand Total"
Set Rng = Range("B:B").Find(What:=FindString, _
After:=Range("B" & Rows.Count), _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then Application.Goto Rng.Offset(0, -1), True
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"KimH" wrote in message ...
Hi,

I need to look at a column and search for the cell that
contains "Grand Total" and select the cell that is to the
left of that cell. Is there a way to do this? 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
selecting a cell Pat Excel Discussion (Misc queries) 1 March 27th 10 09:28 PM
Excel 2007 single cell selecting muliple cell Submit2s Excel Worksheet Functions 1 February 12th 09 04:52 PM
Selecting a cell entry based on cell validation selection Brutalius Excel Worksheet Functions 2 December 17th 08 03:44 AM
Transfer cell values to another cell by selecting button. Gryndar Excel Worksheet Functions 2 November 24th 08 02:21 AM
Selecting the first cell of a row Remko Campagne Excel Programming 3 January 5th 04 04:41 PM


All times are GMT +1. The time now is 05:36 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"