Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Make date show


I would like to have the date show in row'11' if I modify anything in
row '12'. I want to apply this code to the entire row of '11' so that
if I modify 'c12', 'c11' will show the date and so on.


--
oberon.black
------------------------------------------------------------------------
oberon.black's Profile: http://www.excelforum.com/member.php...o&userid=26732
View this thread: http://www.excelforum.com/showthread...hreadid=402018

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Make date show

One way:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

Dim myRngToCheck As Range
Dim myCell As Range

Set myRngToCheck = Me.Rows(12)

If Intersect(Target, myRngToCheck) Is Nothing Then Exit Sub

On Error Resume Next 'try to get all the cells
Application.EnableEvents = False
For Each myCell In Intersect(Target, myRngToCheck).Cells
With myCell.Offset(-1, 0)
.Value = Date
.NumberFormat = "mm/dd/yyyy"
'or maybe?
' .Value = Now
' .NumberFormat = "mm/dd/yyyy hh:mm:ss"
End With
Next myCell
Application.EnableEvents = True
On Error GoTo 0

End Sub

Rightclick on the worksheet tab that should have this behavior. Select view
code and paste this into the code window.

Then back to excel and test it out.

"oberon.black" wrote:

I would like to have the date show in row'11' if I modify anything in
row '12'. I want to apply this code to the entire row of '11' so that
if I modify 'c12', 'c11' will show the date and so on.

--
oberon.black
------------------------------------------------------------------------
oberon.black's Profile: http://www.excelforum.com/member.php...o&userid=26732
View this thread: http://www.excelforum.com/showthread...hreadid=402018


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Make date show


Hi not sure if this is what you want but paste this into the code pag
for the sheet concerned, then when you click any cell in row 12 th
date and time will appear in row 11 as long as row 11 is formatted a
date!

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Row = 12 Then
ActiveCell.Offset(-1, 0) = Date
End If

End Sub

HTH

Simo

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=40201

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Make date show

Try:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ErrorHandler
Application.EnableEvents = False
If Target.Count = 1 And Target.Row = 12 Then
Cells(11, Target.Column) = Date
End If
ErrorHandler:
Application.EnableEvents = True
End Sub

This is worksheet event code. Right click the sheet tab, select View Code
and paste the code in there.

Hope this helps
Rowan

"oberon.black" wrote:


I would like to have the date show in row'11' if I modify anything in
row '12'. I want to apply this code to the entire row of '11' so that
if I modify 'c12', 'c11' will show the date and so on.


--
oberon.black
------------------------------------------------------------------------
oberon.black's Profile: http://www.excelforum.com/member.php...o&userid=26732
View this thread: http://www.excelforum.com/showthread...hreadid=402018


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Make date show


These codes all work perfectly.

Than

--
oberon.blac
-----------------------------------------------------------------------
oberon.black's Profile: http://www.excelforum.com/member.php...fo&userid=2673
View this thread: http://www.excelforum.com/showthread.php?threadid=40201

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
Need help with a project sheet, need date to show/not show based o Max Excel Discussion (Misc queries) 4 December 8th 09 11:01 PM
How do i make the whole y axis label show up it wont show the end Jordan Charts and Charting in Excel 1 November 24th 07 06:07 AM
How to make an Add-in show under Run-Macro mliungman Excel Discussion (Misc queries) 4 January 16th 06 03:35 PM
Make an =if show - instead of 0 Cube Farmer Excel Worksheet Functions 3 August 22nd 05 08:58 PM
how do I make make my hyperlinks show the email address they are . Dustin Excel Discussion (Misc queries) 0 January 13th 05 01:39 AM


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