Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Craig
 
Posts: n/a
Default Return Cell References

I have a staff holiday worksheet showing months across and days (numbered 1
to 31) vertical. As the input box moves I want another cell reference to
show the month name and date ie. if cursor cell ref= b21 then another cell
would display February 21th. I need this to change in real time
irrespective of the data held in the cell actioned.


  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

With the months in B1:M1 and 1-31 in rows 2-32, right-
click the worksheet tab, select "View Code", and paste in
the code below:

Private Sub Worksheet_SelectionChange(ByVal Target As
Excel.Range)
Dim CurrMonth As Long
Dim CurrDay As Long
Dim CurrDate As Date
CurrMonth = ActiveCell.Column - 1
CurrDay = ActiveCell.Row - 1
CurrDate = DateSerial(2005, CurrMonth, CurrDay)
With Me.[A1]
If Month(CurrDate) < CurrMonth Then
.Value = "Non-existent"
Else
.Value = CurrDate
End If
End With
End Sub

---

The first 2 lines are actually one line. The date should
appear in A1.

HTH
Jason
Atlnata, GA

-----Original Message-----
I have a staff holiday worksheet showing months across

and days (numbered 1
to 31) vertical. As the input box moves I want another

cell reference to
show the month name and date ie. if cursor cell ref= b21

then another cell
would display February 21th. I need this to change in

real time
irrespective of the data held in the cell actioned.


.

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
Unable to Copy COUNTA() with cell references EugenioB Excel Worksheet Functions 1 February 16th 05 01:07 PM
Formula to return cell contents based on multiple conditions Bill Excel Worksheet Functions 3 January 19th 05 09:59 AM
Excel: how to formulate conditional cell references centraloffice Excel Worksheet Functions 1 December 10th 04 08:57 PM
Transferring cell content between workbooks using cell references Kiwi Mike Excel Discussion (Misc queries) 2 November 27th 04 11:31 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 06:10 PM.

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"