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
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
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
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,777
Members
449,049
Latest member
greyangel23

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