Link to home
Start Free TrialLog in
Avatar of Kiwi-123
Kiwi-123

asked on

Userform help

Please can you help with the attached?

If I press the command button, I'd like for the userform to insert the Date & Time into the active/highlighted cell.

Format would be "dd/mm/yy HH:MM" which is both taken from textbox 1&2

So once the "Add" button is pressed, the value is entered into whatever active cell on the worksheet.



Book1.xls
Avatar of als315
als315
Flag of Russian Federation image

Test sample
Book1.xls
Avatar of Kiwi-123
Kiwi-123

ASKER

Thanks for your help, seems to work very well. Although two things I noticed is that I get an error message if I put the wrong time in i.e "weer"

The second is that on input it would be great if the next cell is selected to the right. Currently the cursor goes anywhere.
ASKER CERTIFIED SOLUTION
Avatar of als315
als315
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Add string
        .Cells(.Rows.Count, .Columns.Count + 1).Select
after string
        .Cells(.Rows.Count, .Columns.Count).Value = D
for selection of next cell
Many thanks for your help Als!

I still get the "weer" problem in textbox 2 if I acknowledge the "Please enter valid time" and then press ADD.
Additional checking was added
Book1.xls