Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
QD QD is offline
external usenet poster
 
Posts: 12
Default Go to a cell that contains the data entered in another cell

I need help!

I have a spreadsheet with a calendar for all dates in a year. Total
four pages long. Now I am trying to create a Command button that will
help me find todays date or the date that I enter in a cell that I
want to go to, simply by entering date and clicking the command
button. Or enter the date that I am looking for in a cell and hit
enter. It will scroll upto that date in the spreasheet.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Go to a cell that contains the data entered in another cell

Let's say that in A1 thru A365 we have 1/1/2008 thru 12/31/2008. In the
worksheet code area paste:

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("B1")
If Intersect(Target, r) Is Nothing Then Exit Sub
v = r.Value
For i = 1 To 365
If Cells(i, 1) = v Then
Cells(i, 1).Select
Exit Sub
End If
Next
End Sub

Enter a date in cell B1 and you will scroll to that date in A1.
--
Gary''s Student - gsnu2007d


"QD" wrote:

I need help!

I have a spreadsheet with a calendar for all dates in a year. Total
four pages long. Now I am trying to create a Command button that will
help me find todays date or the date that I enter in a cell that I
want to go to, simply by entering date and clicking the command
button. Or enter the date that I am looking for in a cell and hit
enter. It will scroll upto that date in the spreasheet.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
QD QD is offline
external usenet poster
 
Posts: 12
Default Go to a cell that contains the data entered in another cell

On 10 Feb, 06:37, Gary''s Student
wrote:
Let's say that in A1 thru A365 we have 1/1/2008 thru 12/31/2008. *In the
worksheet code area paste:

Private Sub Worksheet_Change(ByVal Target As Range)
Set r = Range("B1")
If Intersect(Target, r) Is Nothing Then Exit Sub
v = r.Value
For i = 1 To 365
* * If Cells(i, 1) = v Then
* * * * Cells(i, 1).Select
* * * * Exit Sub
* * End If
Next
End Sub

Enter a date in cell B1 and you will scroll to that date in A1.
--
Gary''s Student - gsnu2007d



"QD" wrote:
I need help!


I have a spreadsheet with a calendar for all dates in a year. Total
four pages long. Now I am trying to create a Command button that will
help me find todays date or the date that I enter in a cell that I
want to go to, simply by entering date *and clicking the command
button. Or enter the date that I am looking for in a cell and hit
enter. It will scroll upto that date in the spreasheet.


Thanks- Hide quoted text -


- Show quoted text -




Gary's Student,

You are a genious!!

Thanks a bunch. This works great if the dates in one column. I have
set it up as a calendar by month. What I need to do to get the code to
work. January
SUN MON TUE WED THU FRI SAT
01/01/2008 01/02/2008 01/03/2008
01/04/2008 01/04/2008
01/05/2008 and so on.

Thanks a million!!!


  #4   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Go to a cell that contains the data entered in another cell

Gary,
Would it also be possible to get the target cell to scroll all the way
to the top left corner of the screen, eg to "B2"'s position? 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
Locking Cell Once Data is entered Wm Pincumbe Excel Worksheet Functions 3 November 28th 07 06:14 PM
Change color of cell when different cell has data entered B J G Excel Discussion (Misc queries) 1 October 18th 07 07:59 PM
How do I prevent data from being entered into a particular cell? Bryan Excel Discussion (Misc queries) 1 April 7th 07 01:24 AM
data changes when entered into a cell Ian Gill Excel Worksheet Functions 1 October 10th 06 05:39 PM
retaining cell data once entered hoyt New Users to Excel 1 June 28th 06 06:10 PM


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