Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
At present when I change the start date in one cell and end date in another
cell the number of weeks difference between the dates is automatically worked out by a formula in yet another cell. I have recorded macros to alter data in different sheets of the workbook according to the number of weeks difference. But I would like to do it automatically on entering the dates. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
David,
You could use the worksheet change event, but we would need a _little_ more info to help you figure out what to do.... HTH, Bernie MS Excel MVP "DavidM" wrote in message ... At present when I change the start date in one cell and end date in another cell the number of weeks difference between the dates is automatically worked out by a formula in yet another cell. I have recorded macros to alter data in different sheets of the workbook according to the number of weeks difference. But I would like to do it automatically on entering the dates. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would recommend using the on change event to fire the existing macros
something like this... Private Sub Worksheet_Change(ByVal Target As Range) if target.address = "$A$1" or target.address = "$A$2" then _ Call MyMacro() End Sub With this code if either cells A1 or A2 are changed then MyMacro is called. This code needs to be inserted into the sheet with the dates on it. (Right click the tab and select view code). All you need to do is change the cell references and "MyMacro" and you are off to the races... -- HTH... Jim Thomlinson "DavidM" wrote: At present when I change the start date in one cell and end date in another cell the number of weeks difference between the dates is automatically worked out by a formula in yet another cell. I have recorded macros to alter data in different sheets of the workbook according to the number of weeks difference. But I would like to do it automatically on entering the dates. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro start and finish date from rows | Excel Worksheet Functions | |||
How do I alter the date format in the footer in Excel? | Excel Discussion (Misc queries) | |||
Why is MSOHTMED.exe trying to alter the registry when I start Exce | Excel Discussion (Misc queries) | |||
how to alter the date within a macro | Excel Discussion (Misc queries) | |||
Macro to spread values between start and end date | Excel Programming |