Solved

Textbox populate

Posted on 2014-01-21
3
165 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 34

Accepted Solution

by:
Norie earned 500 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

738 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