CopyingPasting contents from one sheet into another results in autofilling date

ufgatorchick

New Member
Joined
Jul 8, 2014
Messages
4
Hi,

DISCLAIMER: I'm completely green and have zero expertise at excel! :)

I've set up project management workbook that helps me keep track of my company's contracts by quarter. The Q3 spreadsheet is the first sheet in the workbook, and I set up some conditional formatting and macros to help automate dates, etc.

I'm now trying to move some rows from that sheet into a new sheet, but when I do, all the rows and columns convert to today's date. Once that happens, it won't let me undo it.

Any way to fix this?

Here is the code I have set up:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 9 Then Target.Offset(0, -1) = Date
If Target.Column = 7 Then Target.Offset(0, 1) = Date
If Target.Column = 1 Then Target.Offset(0, 2) = Date
If Target.Column = 3 Then Target.Offset(0, 9) = Date
End Sub

And here is the sort macro I have set up:
Columns("A:N").Select
ActiveWorkbook.Worksheets("2014Q3").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("2014Q3").Sort.SortFields.Add(Range("L2:L10000"), _
xlSortOnFontColor, xlDescending, , xlSortNormal).SortOnValue.Color = RGB(118, _
147, 60)
ActiveWorkbook.Worksheets("2014Q3").Sort.SortFields.Add Key:=Range("N2:N10000") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("2014Q3").Sort.SortFields.Add(Range("B2:B10000"), _
xlSortOnFontColor, xlDescending, , xlSortNormal).SortOnValue.Color = RGB(36, 64 _
, 98)
ActiveWorkbook.Worksheets("2014Q3").Sort.SortFields.Add Key:=Range("G2:G10000") _
, SortOn:=xlSortOnValues, Order:=xlAscending, CustomOrder:= _
"In Progress,Not Started,Internal Rev,External Rev,Deferred,With OC,Signed,Completed,Abandoned" _
, DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("2014Q3").Sort.SortFields.Add Key:=Range("C2:C10000") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
ActiveWorkbook.Worksheets("2014Q3").Sort.SortFields.Add Key:=Range("A2:A10000") _
, SortOn:=xlSortOnValues, Order:=xlAscending, CustomOrder:= _
"INC,BR,CC,BRI,CARE", DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("2014Q3").Sort
.SetRange Range("A1:N10000")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
 

Some videos you may like

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

ufgatorchick

New Member
Joined
Jul 8, 2014
Messages
4
As an update, I just did some trial and error and isolated that the problem has to do with this code (when I removed the code and that brought the rows over, it worked):

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 9 Then Target.Offset(0, -1) = Date
If Target.Column = 7 Then Target.Offset(0, 1) = Date
If Target.Column = 1 Then Target.Offset(0, 2) = Date
If Target.Column = 3 Then Target.Offset(0, 9) = Date
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,109,383
Messages
5,528,385
Members
409,817
Latest member
JiNXX9500

This Week's Hot Topics

  • Change military grades into rank
    Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
  • VBA COUNTIF SOLUTION
    Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
  • INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
    Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...
  • Auto-Create a monthly Sign in sheet for preschool students
    The image below is what each page looks like. Above is space for the "Child Name" "Month" "Class" School days are obviously Monday-Friday but...
  • VBA vlookup multiple results
    Hi folks, Hopefully someone out there can help. I have a list to vlookup which works (ish). the lookup only picks up the first instance of the...
  • Extract values for earliest/latest times
    I am trying to put together a formula to get the earliest start time, the latest end time from column A for each person in Column B-F without the...
Top