Extended code, now some part doesn't work

Bandito1

Board Regular
Joined
Oct 18, 2018
Messages
233
Office Version
  1. 2016
Platform
  1. Windows
Hi all,

I made some changed to my code but now some part doesn't work;

Original code;

VBA Code:
'Place the date of today in column (O) when data is entered in column (N)
            If (Target.Count = 1) Then
            Application.EnableEvents = False
                If (Not Intersect(Target, Me.Range("N:N")) Is Nothing) Then
                    If Target = vbNullString Then
                        Target.Offset(0, 1) = vbNullString
                    Else
                        Target.Offset(0, 1) = Date
                   End If
                End If
            End If
            Application.EnableEvents = True

The date of today is placed in the column O when data is entered in column N

Now i changed it to;

VBA Code:
'Place the date of today in column (O) when data is entered in column (N)
            If (Target.Count = 1) Then
            Application.EnableEvents = False
                If (Not Intersect(Target, Me.Range("N:N")) Is Nothing) Then
                    If Target = vbNullString Then
                        Target.Offset(0, 1) = vbNullString
                    Else
                        Target.Offset(0, 1) = Date
                With Medicinereturns
                .lblProductcodeR = Cells(Target.Row, "B")
                .lblBatchnumberR = Cells(Target.Row, "A")
                .lblDepartmentR = "Medicine"
                .lblReviewerR.Caption = Cells(Target.Row, "F")
                .txtStDate = Format(Now(), "dd/mmm/yy")
                .Show
                End With
                    End If
                End If
            End If
            Application.EnableEvents = True

The code works but now the date isn't placed in column O when i enter date in N

Someone can find out why that isn't working anymore?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Never mind, noticed that it works after a restart of my excell..
 
Upvote 0

Forum statistics

Threads
1,215,026
Messages
6,122,743
Members
449,094
Latest member
dsharae57

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top