ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problems with vb in excel (https://www.excelbanter.com/excel-programming/315122-problems-vbulletin-excel.html)

Johnsey[_3_]

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


Frank Kabel

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



Bob Phillips[_6_]

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





All times are GMT +1. The time now is 11:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com