Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Alter data or start macro from a date formula

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Alter data or start macro from a date formula

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Alter data or start macro from a date formula

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
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
Macro start and finish date from rows Marylou Excel Worksheet Functions 16 August 17th 09 02:58 PM
How do I alter the date format in the footer in Excel? haryalco Excel Discussion (Misc queries) 1 October 9th 07 04:40 PM
Why is MSOHTMED.exe trying to alter the registry when I start Exce MC Excel Discussion (Misc queries) 3 January 14th 06 05:37 PM
how to alter the date within a macro LWhite Excel Discussion (Misc queries) 2 January 4th 05 01:54 PM
Macro to spread values between start and end date Mark[_27_] Excel Programming 2 October 9th 03 10:33 PM


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