Date on userform shows tomorros date NOT todays

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,596
Office Version
  1. 2007
Platform
  1. Windows
Hi,
On my userform in TextBox 8 i have coded to show the current date.
For some reason it shows tomorrows date as opposed todays date ?

Please see attached screenshot

This is the code in use & line of code shown in Red.

Rich (BB code):
Private Sub Userform_Initialize()
Dim s As Worksheet, b1 As Range, b2 As Range
TextBox2.Visible = False
TextBox3.Visible = False
TextBox4.Visible = False
TextBox5.Visible = False
TextBox6.Visible = False
TextBox7.Visible = False
OptionButton1.Visible = False
OptionButton2.Visible = False
OptionButton3.Visible = False
OptionButton4.Visible = False

    TextBox8.Value = Format(Date, "mm/dd/yyyy")

    Me.StartUpPosition = 0
    Me.Top = Application.Top + 200  ' MARGIN FROM TOP OF SCREEN
    Me.Left = Application.Left + Application.Width - Me.Width - 150 ' LEFT / RIGHT OF SCREEN
    
    
    With GetObject("C:\Users\Ian\Desktop\REMOTES ETC\DR\DR.xlsm")
        Set s = .Sheets("POSTAGE")
        Set b2 = s.Cells(s.Range("B" & s.UsedRange.Rows.Count + 1).End(xlUp).Row, "B")
        Set b1 = b2.Offset(-5, 0)
        ComboBox1.List = s.Range(b1, b2).Value
       .Close 0
End With


End Sub
 

Attachments

  • EaseUS_2024_07_ 6_12_17_49.jpg
    EaseUS_2024_07_ 6_12_17_49.jpg
    20.9 KB · Views: 8

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Answer after looking for ages is the format

mm/dd/yyyy IT SHOULD OF BEEN dd/mm/yyyy
 
Upvote 0
Solution

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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