?
Solved

Formula Help

Posted on 2014-01-15
7
Medium Priority
?
287 Views
Last Modified: 2014-01-17
Hello, tyring to get some data to appear on a page.  Here is the formula i have in a vba code need some help fixing it.  Thank You

Sheet18.textbox270.Value = "Current As Of:" & Format(Date, "yyyy-mm-dd hh:MM:ss")
0
Comment
Question by:sandramac
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 12

Expert Comment

by:tel2
ID: 39784337
What does your current code produce, exactly, Sandra?
0
 

Author Comment

by:sandramac
ID: 39784352
I get a method or data member not found.
0
 
LVL 3

Expert Comment

by:Sreeram
ID: 39784651
Are you trying to display the value in a text box control or in a cell.?

Try this:

For cell :

  Activecell.value=Format(Date, "yyyy-mm-dd hh:MM:ss")

Note: you need to format the cell as per your requirement . By right clicking and select formt cells

For Control:
the control name will be unique for the whole work book

textbox270=Format(Date, "yyyy-mm-dd hh:MM:ss")
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 12

Expert Comment

by:tel2
ID: 39786926
Hi kujumbio,

> For cell :
>  Activecell.value=Format(Date, "yyyy-mm-dd hh:MM:ss")
> Note: you need to format the cell as per your requirement . By right clicking and select formt cells

Is there any point in using the Format() function to format data in a cell which is already formatted appropriately?
Why don't we just format the cell (manually, as you suggested), then use a formula like this:
    Activecell.value=Date
0
 
LVL 3

Expert Comment

by:Sreeram
ID: 39787612
Hi tel2

       If you use only date it will be based on the regional setting of the system . what i made is double check for the format.
0
 
LVL 43

Accepted Solution

by:
Rob earned 2000 total points
ID: 39787716
I tried your code and Date only returns the day/month/year component and not the time.  You should use Now with parenthesis eg Now() as it is calling a function returning a value

Sheet18.textbox270.Value = "Current As Of:" & Format(Now(), "yyyy-mm-dd hh:MM:ss")

I've tested with an ActiveX textbox that it looks like you're using.
0
 

Author Closing Comment

by:sandramac
ID: 39790077
Thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

809 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