Insert Today() and remain static

gr8trthanu72

New Member
Joined
Nov 15, 2013
Messages
31
Good Day,
I am currently using VBA code to move data from a sheet called "Issues Line/ws1" with up to 50 rows to another sheet called "Issues Log/ws2" using the code below.
The code would copy and paste the data into "Issues Log/ws2" starting in column C. The data is copied and pasted to the next available row on the Issues Log sheet. Every time a row is copied and pasted I would like the date inserted into column A of the same line and remain static. I have searched for solutions but have failed to find any.

the code below inserts the date but it updates every time the file is opened. As well, I only copy over 50 rows maximum at a time but after two macros I could have 100 lines so the A50 wont work

If ws1.Range("B50").Value <> "-" Then
DestRow = ws2.Cells(Rows.Count, "C").End(xlUp).Row + 1
'ws2.Range("A50").Value = Now
ws1.Range("B50:J50").Copy
ws2.Range("C" & DestRow).PasteSpecial Paste:=xlPasteValues
ws2.Range("A50").Value = Now
End If

Thank YOu in advance
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
It doesn't update when closed and reopened for me (and shouldn't update as it isn't a formula).
As for your 2nd question I take it that you want it inserting the date in the next empty cell for which you can try...
VBA Code:
ws2.Cells(Rows.Count, "A").End(xlUp)(2).Value = Date
or use the variable that you already have i.e.
VBA Code:
ws2.Range("A" & DestRow).Value = Date
Please note that I have used Date as that is what you asked for in the question not date and time which is what Now gives.
 
Upvote 0

Forum statistics

Threads
1,214,780
Messages
6,121,522
Members
449,037
Latest member
tmmotairi

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