Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Textbox populate

Posted on 2014-01-21
3
Medium Priority
?
170 Views
Last Modified: 2014-01-21
Trying to get TextBox2 to read "Valid From: dd-mmm-yyyy hh:mm to dd-mmm-yyyy hh:mm +12 hours EST.  You would be adding 12 hours to the current time.

 An example would be "Valid From 19-Jan-2014 14:00 to 20-Jan-2014 02:00 EST"


Sheet18.TextBox2.Value = "Valid From: " & Format(Now(), "dd-mmm-yyyy hh:MM:ss") & " EST"
0
Comment
Question by:sandramac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 29

Expert Comment

by:IrogSinta
ID: 39799020
Try this:
Sheet18.TextBox2.Value = "Valid From: " & Format(DateAdd("h", 12, Now()), "dd-mmm-yyyy hh:MM:ss") & " EST"

Open in new window

Ron
0
 
LVL 35

Accepted Solution

by:
Norie earned 2000 total points
ID: 39799052
If it's an ActiveX textbox.
    Sheet18.TextBox2.Value = "Valid From: " & Format(Now(), "dd-mmm-yyyy hh:MM:ss") & " to " & Format(Now() + TimeSerial(12, 0, 0), "dd-mmm-yyyy hh:MM:ss") & " EST"

Open in new window


If it's a Forms textbox.
Dim txt As Object

    Set txt = Sheet18.Shapes("TextBox2").OLEFormat.Object
    txt.Text = "Valid From: " & Format(Now(), "dd-mmm-yyyy hh:MM:ss") & " to " & Format(Now() + TimeSerial(12, 0, 0), "dd-mmm-yyyy hh:MM:ss") & " EST"

Open in new window


By the way, if the text won't change you might want to consider a label instead of a textbox.
0
 

Author Closing Comment

by:sandramac
ID: 39799115
Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question