LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to insert Now() when cell updates


Hi there,

I'm trying to write a macro, so that if a cell in a range has a valu
placed in it - Now() is written to a corresponding cell in anothe
column, then the value copied and pasted (so that it does not update).

I have this -

private sub worksheet_change(byval target as range)

if target.address(false, false) = \"f6:f45\" then
application.enableevents = false

if range(\"f6:f45\") = \"1\" then
range(\"d6:d45\").value = now()

else
range(\"d6:d45\") = \"no call taken\"

end if

application.enableevents = true

end if

range(\"d6:d45\").select
selection.copy
range(\"d6:d45\").select
selection.pastespecial paste:=xlpastevalues, operation:=xlnone
skipblanks _
:=false, transpose:=false

end sub

For some reason it does not want to work for me. I have EnableEvent
set to True on workbook open and am running Office XP.

Would appreciate any advice to steer me in the right direction as I a
still quite new to VBA!

Thanks

Ro

--
systemati
-----------------------------------------------------------------------
systematic's Profile: http://www.excelforum.com/member.php...fo&userid=2529
View this thread: http://www.excelforum.com/showthread.php?threadid=49610

 
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
if/then insert date but don't want automatic updates redleg Excel Discussion (Misc queries) 7 September 29th 09 09:59 PM
'IF' Macro to insert cell contents to alternate cell if cell not e Gryndar Excel Worksheet Functions 6 December 20th 08 05:02 PM
Macro to Insert Comment to a cell wojo Excel Programming 0 July 21st 05 04:06 PM
Macro updates Glen Mettler[_4_] Excel Programming 3 June 29th 05 01:02 AM
Macro updates and link goes #REF! ??? Rob Smith Links and Linking in Excel 1 February 16th 05 01:03 PM


All times are GMT +1. The time now is 05:17 AM.

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"