VBA Time format displays "FALSE" in my wooksheet instead of time

furant

New Member
Joined
May 19, 2016
Messages
5
Hi..

Im just new here and also in VBA. (just like 48 hours ago when i started)

I made a mistake on deleting a bunch of lines earlier but i managed to retype them because i got a a print screen saved. but things doesn't work the same.

i got this code where I want to display the name, time and date of the user when ever he logs in.

this is under a sub way too long to include all, but i think the problem is in these lines only.

'*****************
'Find Rows
'*****************
namerow = Sheet2.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
daterow = Sheet2.Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).Row
timerow = Sheet2.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0).Row

'*****************
'Enter Name, Time and Date
'*****************
Sheet2.Cells(namerow, 1) = Me.cmblist
Sheet2.Cells(daterow, 2) = Format(Now() = "dd-mmm")
Sheet2.Cells(timerow, 3) = Format(Now() = "hh:mm AMPM")

but everytime i run it, excel displays the username in A2, FALSE (for the date) in B2 and FALSE also for the time in C2.

i tried looking for answers and retyped them again and again..
cant find a way to let it show what i want T_T

thanks for the help..
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Code:
Sheet2.Cells(daterow, 2) = Format(Now(), "dd-mmm")
Sheet2.Cells(timerow, 3) = Format(Now(), "hh:mm AMPM")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,430
Messages
6,124,846
Members
449,194
Latest member
HellScout

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