copy date from one column to another minus one day and copy to end of data set

fvisions

Board Regular
Joined
Jul 29, 2008
Messages
191
Office Version
  1. 365
Platform
  1. Windows
Last to rows of this code below I added from a marco test but get a error 438 - Object doesnt support this property or method.
What I am attempting to do is in col E = col J-1 Column J is a start date and column E is the end date so 2/22/21 start date = 2/21/21 end date. Can yo help me with what I am missing?

VBA Code:
Dim sh As Worksheet
Set sh = Sheets("Installation wkg")
Worksheets("Installation wkg").Range("A1").AutoFilter Field:=13, Criteria1:="MUSL"

Dim LastRow As Long
LastRow = Sheets("Installation wkg").Cells(Rows.Count, 2).End(xlUp).Row
Application.ScreenUpdating = False
 
With Sheets("ADD & END Operand Mode2 Delivry")
   Sheets("Installation wkg").Range("H2:H" & LastRow).Copy Destination:=.Range("B3")
   Sheets("Installation wkg").Range("I2:I" & LastRow).Copy Destination:=.Range("C3")
   Sheets("Installation wkg").Range("K2:K" & LastRow).Copy Destination:=.Range("D3")
   Sheets("Installation wkg").Range("W2:W" & LastRow).Copy Destination:=.Range("I3")
   Sheets("Installation wkg").Range("AA2:AA" & LastRow).Copy Destination:=.Range("M3")
   Sheets("Installation wkg").Range("X2:X" & LastRow).Copy Destination:=.Range("J3")
   
   .Columns("J:J").NumberFormat = "mm/dd/yyyy"
   .Columns("E:E").NumberFormat = "mm/dd/yyyy"
   .Range("A2").AutoFill .Range("A2:A" & LastRow + 1)
   .Range("F2").AutoFill .Range("F2:F" & LastRow + 1)
.Range("E3").ActiveCell.FormulaR1C1 = "=RC[5]-1"
   .Range("E3").AutoFill .Range("E3:E" & LastRow + 1)
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Remove the "ActiveCell" from the penultimate line.
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,331
Members
452,636
Latest member
laura12345

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