Solved

Formula Help

Posted on 2014-01-15
7
281 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
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!

 
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 500 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

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

Outlook Free & Paid Tools
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

680 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