Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problems with vb in excel


I've been trying to get these to work in excel but i'm not having muc
luck can anyone point me in the right direction. I've put the cod
into vb editor now what do i do?

Private Sub Worksheet_Change(ByVal Target As Range)
Range("A" & Target.Row) = Now()
End Sub

-----------

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Range("C" & Target.Row).Value = Now()
End If
End Sub

I'm trying 2 date stamp a cell when the cell next to it = yes but
want it as a fixed date all the other ways i tried the date would aut
update

F2 is the column with yes in
G2 is the column i want the dates i

--
Johnse
-----------------------------------------------------------------------
Johnsey's Profile: http://www.excelforum.com/member.php...fo&userid=1556
View this thread: http://www.excelforum.com/showthread.php?threadid=27335

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Problems with vb in excel

Hi
you have to put this code in your worksheet module (not in a stadard
module). Also change them to:

Private Sub Worksheet_Change(ByVal Target As Range)
application.enableevents=false
Range("A" & Target.Row) = Now()
application.enableevents=true
End Sub

-----------

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
application.enableevents=false
Range("C" & Target.Row).Value = Now()
End If
application.enableevents=true
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany

"Johnsey" schrieb im Newsbeitrag
...

I've been trying to get these to work in excel but i'm not having

much
luck can anyone point me in the right direction. I've put the code
into vb editor now what do i do?

Private Sub Worksheet_Change(ByVal Target As Range)
Range("A" & Target.Row) = Now()
End Sub

-----------

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Range("C" & Target.Row).Value = Now()
End If
End Sub

I'm trying 2 date stamp a cell when the cell next to it = yes but i
want it as a fixed date all the other ways i tried the date would

auto
update

F2 is the column with yes in
G2 is the column i want the dates in


--
Johnsey
---------------------------------------------------------------------

---
Johnsey's Profile:

http://www.excelforum.com/member.php...o&userid=15560
View this thread:

http://www.excelforum.com/showthread...hreadid=273358


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Problems with vb in excel

John,

This code will put the date in column A if a change is made to B1:B100

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("B1:B100")) Is Nothing Then
With Target
.Offset(0, -1).Value = Format(Date, "dd mmm yyyy")
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--

HTH

RP

"Johnsey" wrote in message
...

I've been trying to get these to work in excel but i'm not having much
luck can anyone point me in the right direction. I've put the code
into vb editor now what do i do?

Private Sub Worksheet_Change(ByVal Target As Range)
Range("A" & Target.Row) = Now()
End Sub

-----------

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Range("C" & Target.Row).Value = Now()
End If
End Sub

I'm trying 2 date stamp a cell when the cell next to it = yes but i
want it as a fixed date all the other ways i tried the date would auto
update

F2 is the column with yes in
G2 is the column i want the dates in


--
Johnsey
------------------------------------------------------------------------
Johnsey's Profile:

http://www.excelforum.com/member.php...o&userid=15560
View this thread: http://www.excelforum.com/showthread...hreadid=273358



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
aauugghhh...#div/o problems & various average formula problems acbel40 Excel Worksheet Functions 5 October 19th 09 05:00 PM
Problems using Excel 2000 to open/save file saved in Excel 2003 [email protected] Excel Discussion (Misc queries) 1 June 29th 05 02:50 AM
Problems with excel please help Paul Moseley Excel Discussion (Misc queries) 2 April 6th 05 09:20 PM
Excel SUM problems Bob H Excel Worksheet Functions 2 December 1st 04 10:18 PM
Problems merging an excel file due to code or file problems? Cindy M -WordMVP- Excel Programming 0 September 14th 04 02:58 PM


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