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

Ok, to put it in simple terms I've a calendar in colum A ranging from cell A1
to A365, In cell B1 i've Today() function.
What I want to do is when I open this excel file I want the active cell in
colum A to be the one that has the corresponding date equal to cell B1. Is
this possibel? Some sort of code? If yes could someone exemplify?
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Set current cell to a specific value

Try somthing like the following:


Dim R As Variant
With ThisWorkbook.Worksheets("Sheet1")
R = Application.Match(.Range("B1"), .Range("A1:A365"), 0)
If IsError(R) = False Then
.Range("A1")(R, 1).Select
End If
End With


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


"Diogo" wrote in message
...
Ok, to put it in simple terms I've a calendar in colum A ranging from cell
A1
to A365, In cell B1 i've Today() function.
What I want to do is when I open this excel file I want the active cell in
colum A to be the one that has the corresponding date equal to cell B1. Is
this possibel? Some sort of code? If yes could someone exemplify?
Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default Set current cell to a specific value

Try this code in the Workbook_Open event

Private Sub Workbook_Open()

Cells(Application.Match((CDbl(Range("b1").Value)), Range("a:a")),
1).Activate

End Sub

Good luck.

Ken
Norfolk, Va


On Jun 25, 4:20 pm, Diogo wrote:
Ok, to put it in simple terms I've a calendar in colum A ranging from cell A1
to A365, In cell B1 i've Today() function.
What I want to do is when I open this excel file I want the active cell in
colum A to be the one that has the corresponding date equal to cell B1. Is
this possibel? Some sort of code? If yes could someone exemplify?
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
Current Time subtract a specific amount every second Jman Excel Worksheet Functions 4 January 26th 10 04:30 AM
Not allowing to continu unless a specific cell has specific answer madubois9 Excel Discussion (Misc queries) 3 October 25th 07 12:45 AM
Send data from userform to specific cell on specific sheet? JennLee Excel Programming 10 March 10th 07 02:55 AM
Link from a specific Cell in Excel to a specific para. in Word CathyK Excel Worksheet Functions 0 August 10th 06 04:40 PM
Highlight a row if a specific cell is specific numbers/words sea0221 Excel Worksheet Functions 2 March 9th 05 12:06 AM


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