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

Hi,

Firstly, I am no expert at VBA!

Application.Goto Range([A1]), scroll:=True

will scroll to the cell specified in A1.

Is there a way to scroll by way of the value in a cell. That is to say, if
the value VR128 were in cell AQ552, is there a way to scroll to that cell by
entering something like (pigeon code)

Application.Goto "VR128",scroll:=True

Any help gratefully recieved,

Regards,

Alan.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Finding a cell

Sub test()
Dim str As String
' in A1 c10 for example
str = Range("A1")
Application.Goto Range(str)
End Sub

Do you mean this Alan
VR128 don't exist


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



"Alan" wrote in message ...
Hi,

Firstly, I am no expert at VBA!

Application.Goto Range([A1]), scroll:=True

will scroll to the cell specified in A1.

Is there a way to scroll by way of the value in a cell. That is to say, if
the value VR128 were in cell AQ552, is there a way to scroll to that cell by
entering something like (pigeon code)

Application.Goto "VR128",scroll:=True

Any help gratefully recieved,

Regards,

Alan.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Finding a cell

Hi Alan

Application.Goto Range(Range("AQ552").Value), scroll:=True

will do the job.

--
Best Regards
Leo Heuser
MVP Excel

Followup to newsgroup only please.

"Alan" skrev i en meddelelse
...
Hi,

Firstly, I am no expert at VBA!

Application.Goto Range([A1]), scroll:=True

will scroll to the cell specified in A1.

Is there a way to scroll by way of the value in a cell. That is to say, if
the value VR128 were in cell AQ552, is there a way to scroll to that cell

by
entering something like (pigeon code)

Application.Goto "VR128",scroll:=True

Any help gratefully recieved,

Regards,

Alan.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 492
Default Finding a cell

Ron and Leo,
Thanks very much indeed for the replies but I didn't
explain myself properly I don't think. Its hard to do so sometimes when you
are unsure even if its possible and learning,
What I meant was :- Is it possible to find a cell by the
value it contains, not by the reference? ie if any cell in the sheet
contains for example "Cat and Dog" or "1234567" or any other value (these
would be unique), could that cell be found in the same way that Edit Find
would find it, except by using code, and if so to scroll to it? That is to
say, I don't know which cell contains the value, I only know what the value
is, and that is the cell I want to scroll to.
Edit Find will do it I know, but if possible I'd like
to enter the value of the target cell value in say A1, and have a macro
scroll to it via Range([A1])
Thanks Again,
Alan.
(If I'm not making sense, I'll go away and be quiet)

"Leo Heuser" wrote in message
...
Hi Alan

Application.Goto Range(Range("AQ552").Value), scroll:=True

will do the job.

--
Best Regards
Leo Heuser
MVP Excel

Followup to newsgroup only please.

"Alan" skrev i en meddelelse
...
Hi,

Firstly, I am no expert at VBA!

Application.Goto Range([A1]), scroll:=True

will scroll to the cell specified in A1.

Is there a way to scroll by way of the value in a cell. That is to say,

if
the value VR128 were in cell AQ552, is there a way to scroll to that

cell
by
entering something like (pigeon code)

Application.Goto "VR128",scroll:=True

Any help gratefully recieved,

Regards,

Alan.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 492
Default Finding a cell

Hi Leo,
This code does exactly what I wanted it to do, thanks a million
for sharing your expertise with me, not to mention your patience!
Best Wishes,
Alan.

"Leo Heuser" wrote in message
...
You are making perfect sense, Alan :-)

Try something along these lines:
(It won't work for times)
Try experimenting with LookIn:=xlValues


Sub FindItem()
'Leo Heuser, 22-7-2003
Dim FindValue As Variant
Dim Found As Range
Dim SearchRange As Range
Dim SourceCell As Range

Set SourceCell = ActiveSheet.Range("a1")

FindValue = SourceCell.Value

Set SearchRange = ActiveSheet.Cells

Set Found = SearchRange.Find(FindValue, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
MatchCase:=False)
If Not Found Is Nothing Then
If Found.Address = SourceCell.Address Then
Set Found = SearchRange.FindNext(Found)
End If

Application.Goto Found, scroll:=True
End If

End Sub


--
Best Regards
Leo Heuser
MVP Excel

Followup to newsgroup only please.

"Alan" skrev i en meddelelse
...
Ron and Leo,
Thanks very much indeed for the replies but I

didn't
explain myself properly I don't think. Its hard to do so sometimes when

you
are unsure even if its possible and learning,
What I meant was :- Is it possible to find a cell by

the
value it contains, not by the reference? ie if any cell in the sheet
contains for example "Cat and Dog" or "1234567" or any other value

(these
would be unique), could that cell be found in the same way that Edit

Find
would find it, except by using code, and if so to scroll to it? That is

to
say, I don't know which cell contains the value, I only know what the

value
is, and that is the cell I want to scroll to.
Edit Find will do it I know, but if possible I'd

like
to enter the value of the target cell value in say A1, and have a macro
scroll to it via Range([A1])
Thanks Again,
Alan.
(If I'm not making sense, I'll go away and be quiet)

"Leo Heuser" wrote in message
...
Hi Alan

Application.Goto Range(Range("AQ552").Value), scroll:=True

will do the job.

--
Best Regards
Leo Heuser
MVP Excel

Followup to newsgroup only please.

"Alan" skrev i en meddelelse
...
Hi,

Firstly, I am no expert at VBA!

Application.Goto Range([A1]), scroll:=True

will scroll to the cell specified in A1.

Is there a way to scroll by way of the value in a cell. That is to

say,
if
the value VR128 were in cell AQ552, is there a way to scroll to that

cell
by
entering something like (pigeon code)

Application.Goto "VR128",scroll:=True

Any help gratefully recieved,

Regards,

Alan.












  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Finding a cell

You're welcome, Alan.
Glad to be able to help.
Thanks for the feedback It's always appreciated..

--
Best Regards
Leo Heuser

"Alan" skrev i en meddelelse
...
Hi Leo,
This code does exactly what I wanted it to do, thanks a million
for sharing your expertise with me, not to mention your patience!
Best Wishes,
Alan.



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
finding last non-blank cell and then copying it to the next cell mike_vr Excel Discussion (Misc queries) 0 January 17th 08 05:02 PM
Finding a numerical value within a cell Cecilia Excel Worksheet Functions 5 December 4th 07 11:58 PM
Finding Corresponding Cell Value Ken Excel Discussion (Misc queries) 2 August 19th 07 03:49 PM
Finding last cell Jim[_2_] Excel Worksheet Functions 15 February 17th 07 07:45 PM
Finding row # of last cell containing contents Bob Excel Worksheet Functions 7 January 8th 07 07:13 PM


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