Help with code

Janeyo

New Member
Joined
Dec 15, 2016
Messages
6
Hi, I need help with some code to copy a current time stamp which is a showing as an =NOW() in a static cell and paste it as a value into the next empty cell in a column on the press of a button. Can somebody help me please
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

AliGW

Banned
Joined
Mar 9, 2014
Messages
3,628
You could apply this macro I just recorded to your button:

Code:
Sub Copy_Datestamp()
'
' Copy_Datestamp Macro
'

'
    Range("B2").Select
    Selection.Copy
    Range("D2").Select
    Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
        xlNone, SkipBlanks:=False, Transpose:=False
End Sub
 
Upvote 0

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
19,343
Office Version
  1. 2021
Platform
  1. Windows
ADVERTISEMENT
Try this:

Code:
Sub Test()
Dim Lastrow As Long
Lastrow = Cells(Rows.Count, "B").End(xlUp).Row + 1
Cells(Lastrow, "B").Value = Cells(2, "B").Value
End Sub
 
Upvote 0

Forum statistics

Threads
1,195,650
Messages
6,010,920
Members
441,572
Latest member
keobongda8812

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
Top