Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Clarification - how to automatically update cells with a date and date range | Excel Discussion (Misc queries) | |||
how to make auto date update work on a range of cells. | Excel Programming | |||
Auto Sum a Range of Cells based on the date | Excel Discussion (Misc queries) | |||
How do I make a name formula auto update in Excel | Excel Worksheet Functions | |||
Auto refresh and DDE update is not work when running macro | Excel Programming |