Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default how to make auto date update work on a range of cells.

Sorry, very new to formulas and code. The code below will populate a cell
with the update date/time when the cell next to it is updated. Works
GREAT...on that one cell! How do I apply this code to an entire column? I'm
sure I need to enter a range of cells somehow into this code but I don't know
how to do this.

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$7" Then
Target.Offset(0, 1) = Format$(Now, "dd/mm/yy hh:mm")
End If
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default how to make auto date update work on a range of cells.

You were telling it to only do it for a particular cell address. You can do
it with the entire column D with this:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 4 Then 'D is the 4th column
Target.Offset(0, 1) = Format$(Now, "dd/mm/yy hh:mm")
End If
End Sub
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"cashnic" wrote:

Sorry, very new to formulas and code. The code below will populate a cell
with the update date/time when the cell next to it is updated. Works
GREAT...on that one cell! How do I apply this code to an entire column? I'm
sure I need to enter a range of cells somehow into this code but I don't know
how to do this.

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$7" Then
Target.Offset(0, 1) = Format$(Now, "dd/mm/yy hh:mm")
End If
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default how to make auto date update work on a range of cells.

You asked this same question an hour ago and received the same answer you
just got here.

Why did I bother an hour ago?


Gord Dibben MS Excel MVP

On Thu, 18 Jun 2009 09:20:15 -0700, cashnic
wrote:

Sorry, very new to formulas and code. The code below will populate a cell
with the update date/time when the cell next to it is updated. Works
GREAT...on that one cell! How do I apply this code to an entire column? I'm
sure I need to enter a range of cells somehow into this code but I don't know
how to do this.

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$7" Then
Target.Offset(0, 1) = Format$(Now, "dd/mm/yy hh:mm")
End If
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default how to make auto date update work on a range of cells.

Sorry Gord, it was not intentional. I have not used this tool before and was
not sure whether I should ask my question as "new" or from an existing
string. My apologies, I appreciate the help!

"Gord Dibben" wrote:

You asked this same question an hour ago and received the same answer you
just got here.

Why did I bother an hour ago?


Gord Dibben MS Excel MVP

On Thu, 18 Jun 2009 09:20:15 -0700, cashnic
wrote:

Sorry, very new to formulas and code. The code below will populate a cell
with the update date/time when the cell next to it is updated. Works
GREAT...on that one cell! How do I apply this code to an entire column? I'm
sure I need to enter a range of cells somehow into this code but I don't know
how to do this.

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$7" Then
Target.Offset(0, 1) = Format$(Now, "dd/mm/yy hh:mm")
End If
End Sub



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default how to make auto date update work on a range of cells.

The first time you asked was within another thread.

When you do that, don't start a new thread without waiting a while to see if
you get a response.

Sometimes you won't because people think that old thread was finished.

The you post a new thread.

We'll let you off this time since you are new here<g


Gord

On Thu, 18 Jun 2009 11:50:01 -0700, cashnic
wrote:

Sorry Gord, it was not intentional. I have not used this tool before and was
not sure whether I should ask my question as "new" or from an existing
string. My apologies, I appreciate the help!

"Gord Dibben" wrote:

You asked this same question an hour ago and received the same answer you
just got here.

Why did I bother an hour ago?


Gord Dibben MS Excel MVP

On Thu, 18 Jun 2009 09:20:15 -0700, cashnic
wrote:

Sorry, very new to formulas and code. The code below will populate a cell
with the update date/time when the cell next to it is updated. Works
GREAT...on that one cell! How do I apply this code to an entire column? I'm
sure I need to enter a range of cells somehow into this code but I don't know
how to do this.

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$D$7" Then
Target.Offset(0, 1) = Format$(Now, "dd/mm/yy hh:mm")
End If
End Sub




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
Clarification - how to automatically update cells with a date and date range Bekki Excel Discussion (Misc queries) 1 August 31st 10 03:18 AM
how to make auto date update work on a range of cells. Jacob Skaria Excel Programming 1 June 18th 09 05:35 PM
Auto Sum a Range of Cells based on the date jcpotwor Excel Discussion (Misc queries) 3 January 17th 07 07:20 PM
How do I make a name formula auto update in Excel Sammy Soup Excel Worksheet Functions 3 December 30th 04 05:18 PM
Auto refresh and DDE update is not work when running macro Eddy[_5_] Excel Programming 0 July 13th 04 10:08 AM


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