VBA & Macro Problems

How to Create a VBA Macro to Insert Current Time Plus One Minute in WPS Office Spreadsheets

Steven ParkerSteven Parker Nov 13, 2026 869 views

Question details

User needs a VBA macro that writes the current time plus one minute into the selected WPS Office Spreadsheets cell and formats it as a time-only value.

How to Create a VBA Macro to Insert Current Time Plus One Minute in WPS Office Spreadsheets
Product
WPS Office Spreadsheets
Device & OS
not provided
Scenario
Creating or updating a timesheet where a macro should stamp a time one minute ahead into a selected cell.
Observed behavior
The macro should calculate and enter the target time; for example, when the current time is 19:30, the cell should receive 19:31.
Before you start

Open the target workbook in WPS Office Spreadsheets, enable the Developer tab, and save the file as a macro-enabled workbook (.xlsm) before adding or running the VBA macro.

Solution 1Recommended

Use DateAdd("n", 1, Now) in a WPS Office Spreadsheets VBA Macro

Best for automatically stamping a time one minute ahead into the selected cell while preserving a time-only display.

This VBA solution uses the DateAdd function to add one minute to the current system time. The Now function returns both date and time, so format the target cell as h:mm if you only want the time to appear.

1
Open the Visual Basic Editor

In WPS Office Spreadsheets, click the Developer tab and select Visual Basic, or press Alt+F11.

2
Insert a module

In the Visual Basic Editor, click Insert > Module to create a new standard module.

3
Paste the macro code

Paste the following macro into the module: Sub TimePlusOne() ActiveCell.Value = DateAdd("n", 1, Now) End Sub

4
Run the macro

Return to the sheet and run the macro from Developer > Macros, or press Alt+F8 and select TimePlusOne.

5
Format the cell as time

Select the destination cell, press Ctrl+1, choose Time, and set the type to h:mm to hide the date part.

Use DateAdd("n", 1, Now) in a WPS Office Spreadsheets VBA Macro
Macro result: The selected cell now shows the current time plus one minute. Set the cell format to h:mm to display only the time.
WPS Office Spreadsheets VBA

Create and Run a Time VBA Macro in WPS Office Spreadsheets

WPS Office Spreadsheets supports VBA macros and Excel-compatible workbooks, so you can use DateAdd to insert the current time plus one minute and keep your timesheet workflow automated.

  1. 1. Open WPS Office Spreadsheets: Launch WPS Office and open or create the workbook where you want to run the macro.
  2. 2. Enable the Developer tab: Right-click the ribbon, choose Customize Ribbon, enable Developer, and click OK.
  3. 3. Create the macro: Click Developer > Visual Basic, insert a module, and paste the DateAdd macro code.
  4. 4. Run the macro: Select the target cell, go to Developer > Macros, select TimePlusOne, and click Run.
  5. 5. Format and save: Format the cell as h:mm using Ctrl+1 > Time, then save the workbook as an Excel Macro-Enabled Workbook (.xlsm).
Runs VBA macros and DateAdd functions for automated timesheet timestampsOpens and saves Excel .xlsm and .xlsx files for Microsoft Office format compatibilityFree, lightweight WPS Office Spreadsheets with a familiar ribbon interfaceEasy migration from Microsoft Excel without rewriting existing macros
microsoft office alternative - wps office

Frequently Asked Questions

What does DateAdd("n", 1, Now) do in the macro?

It adds one minute to the current system date and time. The interval string "n" stands for minutes.

Why does my cell show a long date and time instead of just 19:31?

The Now function returns date and time together. Format the cell as Time and choose a type like h:mm to display only the time.

Can I add more than one minute?

Yes. Replace the 1 in DateAdd("n", 1, Now) with the number of minutes you want to add.

Does this VBA macro work in WPS Office Spreadsheets?

Yes. WPS Office Spreadsheets supports VBA macros and can run this code in a macro-enabled workbook.

Where do I run the macro after adding the code?

Go to Developer > Macros or press Alt+F8, select TimePlusOne, and click Run.